You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 月之前
7 月之前
7 月之前
7 月之前
7 月之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Jëger
  2. A regex engine.
  3. ### Syntax
  4. The aim was to follow Vim's regex syntax. Esoteric special characters such as "\zs" are not implemented, however the just is supported.
  5. ```C
  6. match_t * regex_match(const regex_t * const regex, const char * const string, const bool start_of_string);
  7. ```
  8. Returns a sentinel terminated array of `match_t` objects.
  9. The sentinel object is defined as `(match_t){ .position = -1, .width = -1, };`.
  10. ```C
  11. bool is_sentinel(const match_t * const match);
  12. ```
  13. This is the function you must check whether a `match_t` is a sentinel or not.
  14. I.e. make this the break condition while looping the results.
  15. | Symbol | Meaning (TODO: fill in) |
  16. | :----: | :---------------------: |
  17. | . | |
  18. | ? | One or zero of the previous token |
  19. | = | Same as ? |
  20. | * | Any number of the previous token |
  21. | + | One or more of the previous token |
  22. | \\< | Start of word |
  23. | \\> | End of word |
  24. | ^ | Start of string |
  25. | \t | Tab |
  26. | \n | New line |
  27. | \b | |
  28. | \i | |
  29. | \I | |
  30. | \k | |
  31. | \K | |
  32. | \f | |
  33. | \F | |
  34. | \p | |
  35. | \P | |
  36. | \s | |
  37. | \d | Digit char |
  38. | \D | Not digit char |
  39. | \x | Hex char|
  40. | \X | Not hex char |
  41. | \o | Octal char |
  42. | \O | Not octal char |
  43. | \w | Word char|
  44. | \W | Not word char|
  45. | \h | |
  46. | \a | Ascii letter |
  47. | \l | Lowercase ascii letter |
  48. | \L | Not (lowercase ascii letter) |
  49. | \u | Uppercase ascii letter |
  50. | \U | Not (uppercase ascii letter) |
  51. | [\<range\>] | Any of \<range\> |
  52. | [\^\<range\>] | None of \<range\> |