-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
RegEx: Fix handling of unset/unknown capture groups #73973
Conversation
This makes sense to me. It makes the behavior consistent with Python 3's
Also checked
And
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be merged as is, but indeed there's a case to be made about what the return value should be in case of failure.
f3c7982
to
6992554
Compare
I've just been thinking that it would be good to add a unit test for those changes. |
6992554
to
d9523f7
Compare
d9523f7
to
678bf5d
Compare
678bf5d
to
0339032
Compare
PCRE2_SUBSTITUTE_UNSET_EMPTY
flag and output error messages
Thanks! |
Add the
PCRE2_SUBSTITUTE_UNSET_EMPTY
flag so that unset capture groups do not clear the line.https://www.pcre.org/current/doc/html/pcre2api.html
Example:
Before:
After: