Closed burnpanck closed 11 months ago
there are two problems:
a) non-capturing groups are (?: )
and not the >
and if you want the group to be optional then (?: )?
b) first-follow optimizer for some reason is angry about >
ok, you are not using non-capturing group, but atomic group which is not yet implemented, I made the error message a bit better, not sure if I know how to implement it for now
Aha! I know (?:...)
from python, but have very little experience with PCRE regexes. On regex101 (?>...)
was indeed described as "Atomic group (non-capturing)", and I didn't look any further. Interestingly, it appears that (?>...)
does (did?) compile with ctre
, at least on it's own without quantifier.
It compiled but it always returned false.
ok, you are not using non-capturing group, but atomic group which is not yet implemented, I made the error message a bit better, not sure if I know how to implement it for now
I know this library supports
possessive quantifiers, isn't (?:x){1}+
equivalent to (?>x)
?
@iulian-rusu right, I implemented it now as such transformation, thanks you :)
When trying to compile a pattern that includes a non-capturing group
(>?...)
that is optional, the compilation fails witherror: no matching function for call to 'first'
(on clang, similar on gcc).See https://godbolt.org/z/494Mdcea3