Skip to content

Commit

Permalink
Updates for missing features in regular expressions. (#1337)
Browse files Browse the repository at this point in the history
* Added handling of \G.

* Added find_all method to regular expressions.

* Implementation of reverse token generation.

* Implementation of lookbehind parsing.

* Hack for reverse matching.

* Removed Iter from wrapper and added it to the generated functions.

* Removed `wrap` helper.

* Implementation of advanced regexes.

* Added implementation for nested lookaround.

* Update for regex status.

* Added atomic grouping token.

* Code cleanup.

* Update of Regression tests.

* Header update for new version.

* Updates for clang.

* Update for tests.
  • Loading branch information
MaxSagebaum authored Jan 31, 2025
1 parent 2a36dfa commit ec1f98a
Show file tree
Hide file tree
Showing 95 changed files with 26,156 additions and 14,976 deletions.
20 changes: 10 additions & 10 deletions docs/notes/regex_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The listings are taken from the [Perl regex docs](https://perldoc.perl.org/perlr
| **`s`** | Treat the string as single line. That is, change `.` to match any character whatsoever, even a newline, which normally it would not match. | <span style="color:green">Supported</span> |
| ***`x` and `xx`** | Extend your pattern's legibility by permitting whitespace and comments. For details see: [Perl regex docs: `/x` and `/xx`](https://perldoc.perl.org/perlre#/x-and-/xx). | <span style="color:green">Supported</span> |
| **`n`** | Prevent the grouping metacharacters `(` and `)` from capturing. This modifier will stop `$1`, `$2`, etc. from being filled in. | <span style="color:green">Supported</span> |
| **`c`** | Keep the current position during repeated matching. | <span style="color:gray">Planned</span> |
| **`c`** | Keep the current position during repeated matching. | <span style="color:green">Supported</span> |


### Escape sequences __(Complete)__
Expand Down Expand Up @@ -96,7 +96,7 @@ The listings are taken from the [Perl regex docs](https://perldoc.perl.org/perlr
| **`\A`** | Match only at beginning of string | <span style="color:green">Supported</span> |
| **`\Z`** | Match only at end of string, or before newline at the end | <span style="color:green">Supported</span> |
| **`\z`** | Match only at end of string | <span style="color:green">Supported</span> |
| **`\G`** | Match only at pos() (e.g. at the end-of-match position of prior m//g) | <span style="color:gray">Planned</span> |
| **`\G`** | Match only at pos() (e.g. at the end-of-match position of prior m//g) | <span style="color:green">Supported</span> |


### Capture groups __(Complete)__
Expand Down Expand Up @@ -128,8 +128,8 @@ The listings are taken from the [Perl regex docs](https://perldoc.perl.org/perlr
| **`(?'NAME'pattern)`** | Named capture group | <span style="color:green">Supported</span> |
| **`(?(condition)yes-pattern`<code>&#124;</code>`no-pattern)`** | Conditional patterns. | <span style="color:gray">Planned</span> |
| **`(?(condition)yes-pattern)`** | Conditional patterns. | <span style="color:gray">Planned</span> |
| **`(?>pattern)`** | Atomic patterns. (Disable backtrack.) | <span style="color:gray">Planned</span> |
| **`(*atomic:pattern)`** | Atomic patterns. (Disable backtrack.) | <span style="color:gray">Planned</span> |
| **`(?>pattern)`** | Atomic patterns. (Disable backtrack.) | <span style="color:green">Supported</span> |
| **`(*atomic:pattern)`** | Atomic patterns. (Disable backtrack.) | <span style="color:green">Supported</span> |


### Lookaround Assertions
Expand All @@ -142,12 +142,12 @@ The listings are taken from the [Perl regex docs](https://perldoc.perl.org/perlr
| **`(?!pattern)`** | Negative look ahead. | <span style="color:green">Supported</span> |
| **`(*nla:pattern)`** | Negative look ahead. | <span style="color:green">Supported</span> |
| **`(*negative_lookahead:pattern)`** | Negative look ahead. | <span style="color:green">Supported</span> |
| **`(?<=pattern)`** | Positive look behind. | <span style="color:gray">Planned</span> |
| **`(*plb:pattern)`** | Positive look behind. | <span style="color:gray">Planned</span> |
| **`(*positive_lookbehind:pattern)`** | Positive look behind. | <span style="color:gray">Planned</span> |
| **`(?<!pattern)`** | Negative look behind. | <span style="color:gray">Planned</span> |
| **`(*nlb:pattern)`** | Negative look behind. | <span style="color:gray">Planned</span> |
| **`(*negative_lookbehind:pattern)`** | Negative look behind. | <span style="color:gray">Planned</span> |
| **`(?<=pattern)`** | Positive look behind. | <span style="color:green">Supported</span> |
| **`(*plb:pattern)`** | Positive look behind. | <span style="color:green">Supported</span> |
| **`(*positive_lookbehind:pattern)`** | Positive look behind. | <span style="color:green">Supported</span> |
| **`(?<!pattern)`** | Negative look behind. | <span style="color:green">Supported</span> |
| **`(*nlb:pattern)`** | Negative look behind. | <span style="color:green">Supported</span> |
| **`(*negative_lookbehind:pattern)`** | Negative look behind. | <span style="color:green">Supported</span> |


### Special Backtracking Control Verbs
Expand Down
Loading

0 comments on commit ec1f98a

Please sign in to comment.