Summary
Possessive quantifiers (*+, ++, ?+, {n,m}+) are not supported. Like atomic groups, they match as much as possible and never give back characters to allow other parts of the pattern to match.
Examples
\d++ — consume all digits, never backtrack
[a-z]*+[a-z] — possessive star means the trailing [a-z] can never match (useful to express intent)
"[^"]*+" — efficiently match a quoted string without catastrophic backtracking
Impact
- Filtered from integration test suite (reported as unsupported in
testsuites/README.md)
- Possessive quantifiers are syntactic sugar for
(?>X{n,m}) (atomic group wrapping a quantifier)
Implementation Notes
Summary
Possessive quantifiers (
*+,++,?+,{n,m}+) are not supported. Like atomic groups, they match as much as possible and never give back characters to allow other parts of the pattern to match.Examples
\d++— consume all digits, never backtrack[a-z]*+[a-z]— possessive star means the trailing[a-z]can never match (useful to express intent)"[^"]*+"— efficiently match a quoted string without catastrophic backtrackingImpact
testsuites/README.md)(?>X{n,m})(atomic group wrapping a quantifier)Implementation Notes
RegexParser.java(parse trailing+on quantifiers),ThompsonBuilder.java