Syntax in each engine
Which syntax each engine has, a row a feature. Every cell is checked by running a pattern in that engine itself, Dotstar’s own copy of it, so the table says what the engines do, not what anyone remembers.
✓ has it · — refuses the pattern · ≠ takes it, but it means something else there (often a plain character)
| Feature | JavaScript | PCRE2 | Perl | Python | Java | .NET | Ruby | ICU | Swift | Go | RE2 | Rust | POSIX ERE | C++ ECMAScript | VBScript* |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Non-capturing group (?:…) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
Lazy quantifiers *? +? ?? | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ≠ | ✓ | ✓ |
Possessive quantifiers *+ ++ ?+ | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | — | — | ≠ | ≠ | — | — |
Atomic group (?>…) | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — | — | — | — |
Up to n times, without a minimum {,n} | ≠ | ✓ | ✓ | ✓ | — | ≠ | ✓ | — | ✓ | ≠ | ≠ | — | — | — | ≠ |
Named group (?<name>…) | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
Named group, Python’s spelling (?P<name>…) | — | ✓ | ✓ | ✓ | — | — | — | — | ✓ | ✓ | ✓ | ✓ | — | — | — |
Backreference \1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — | ≠ | ✓ | ✓ |
Named backreference \k<name> | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — | — | — | — |
Lookahead (?=…) (?!…) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — | — | ✓ | ✓ |
Lookbehind (?<=…) (?<!…) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — | — | — | — | — |
Lookbehind of bounded length (?<=a{1,3}) | ✓ | ✓ | ✓ | — | ✓ | ✓ | — | ✓ | — | — | — | — | — | — | — |
Lookbehind of any length (?<=a+) | ✓ | — | — | — | ✓ | ✓ | — | — | — | — | — | — | — | — | — |
Start of the text \A | ≠ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ≠ | — | ≠ |
End of the text \z | ≠ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ≠ | — | ≠ |
Word boundary \b | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Flags in the pattern (?i) | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
Flags for part of it (?i:…) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
Comment (?#…) | — | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | — | — | — | — | — | — |
Character by its code \x{e9} | ≠ | ✓ | ✓ | — | ✓ | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ≠ |
Character by its code, JavaScript’s way \u00e9 | ✓ | — | ≠ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | ✓ | ≠ | ≠ | ✓ |
Unicode property \p{L} | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | ≠ |
\w takes letters past ASCII \w | ≠ | ≠ | ✓ | ✓ | ≠ | ✓ | ≠ | ✓ | ✓ | ≠ | ≠ | ✓ | ✓ | ≠ | ≠ |
\d takes other scripts’ digits \d | ≠ | ≠ | ✓ | ✓ | ≠ | ✓ | ≠ | ✓ | ✓ | ≠ | ≠ | ✓ | ≠ | ≠ | ≠ |
POSIX class in brackets [[:alpha:]] | ≠ | ✓ | ✓ | ≠ | ≠ | ≠ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ≠ |
Keep what came before out of the match \K | ≠ | ✓ | ✓ | — | — | — | ✓ | ≠ | — | — | — | — | ≠ | — | ≠ |
Recursion (?R) | — | ✓ | ✓ | — | — | — | — | — | — | — | — | ≠ | — | — | — |
Conditional (?(1)…|…) | — | ✓ | ✓ | ✓ | — | ✓ | ✓ | — | — | — | — | — | — | — | — |