You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The __last__ capture is embedded in each group, so `g.String()` will return the
43
43
| Category | regexp | regexp2 |
44
44
| --- | --- | --- |
45
45
| Catastrophic backtracking possible | no, constant execution time guarantees | yes, if your pattern is at risk you can use the `re.MatchTimeout` field |
46
-
| Python-style capture groups `(?P<name>re)`| yes | no |
46
+
| Python-style capture groups `(?P<name>re)`| yes | no (yes in RE2 compat mode) |
47
47
| .NET-style capture groups `(?<name>re)` or `(?'name're)`| no | yes |
48
48
| comments `(?#comment)`| no | yes |
49
49
| branch numbering reset `(?\|a\|b)`| no | no |
@@ -54,14 +54,15 @@ The __last__ capture is embedded in each group, so `g.String()` will return the
54
54
| negative lookbehind `(?<!re)`| no | yes |
55
55
| back reference `\1`| no | yes |
56
56
| named back reference `\k'name'`| no | yes |
57
-
| named ascii character class `[[:foo:]]`| yes | no |
57
+
| named ascii character class `[[:foo:]]`| yes | no (yes in RE2 compat mode) |
58
58
| conditionals `(?(expr)yes\|no)`| no | yes |
59
59
60
60
## RE2 compatibility mode
61
61
The default behavior of `regexp2` is to match the .NET regexp engine, however the `RE2` option is provided to change the parsing to increase compatibility with RE2. Using the `RE2` option when compiling a regexp will not take away any features, but will change the following behaviors:
62
62
* add support for named ascii character classes (e.g. `[[:foo:]]`)
63
63
* add support for python-style capture groups (e.g. `(P<name>re)`)
64
-
64
+
* change singleline behavior for `$` to only match end of string (like RE2) (see [#24](https://github.com/dlclark/regexp2/issues/24))
0 commit comments