-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\K
in lookbehind/lookahead should be always invalid
#736
Comments
What is the "global capture group"? I assume you mean, the span of text matched by the expression ( Lookbehind and lookahead do participate in all match attempts. The behaviour of PHP is clearly passing this flag. Perhaps the PHP developers would consider updating their behaviour to the new one. However, this would break any PHP code which was relying on using PCRE2 did not want to force any breaking changes on users, no matter how small, so the PHP developers can choose whether to make this change in their own time, or never. |
Yes, I mean "global capture group" ==
That is the point of this issue.
What is the flag and can I list/check the flags on runtime? Is there some docs where can I see all flags with examples?
I see, https://3v4l.org/g4Ldi works. I am closing this issue as all is probably expected due BC reasons. |
The flag is PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK. Its effect is documented here: https://pcre2project.github.io/pcre2/doc/pcre2api/ I thought you had maybe seen that documentation already, since only last week I updated it to be much more precise in its description of PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK. You should open an issue on the PHP bugtracker, to see if they would consider removing their use of this (semi-deprecated) flag. |
My two cents: these flags have not much effect. \K side effect without placing it into an assertion:
|
Ouch! That's very bad Zoltan. Hmm. We should fix that... somehow. It would be possible (but nasty) to do it at compile-time, building a graph of parts of the pattern visited by assertions, or else, doing it at run-time somehow... Yuck yuck yuck. |
This option is semi-deprecated [1] and shouldn't influence much anyway. The anticipated BC break is low. [1] PCRE2Project/pcre2#736 (comment) [2] PCRE2Project/pcre2#736 (comment) Closes GH-18150.
\K
in lookbehind/lookahead should be always invalid as it affects "the global capture group" only, but lookbehind/lookahead does not participate in global capture group matching.repro: https://3v4l.org/W9s8q
The text was updated successfully, but these errors were encountered: