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
gh-91760: More strict rules for numerical group references and group names in RE #91792
Conversation
…group names in RE Only sequence of ASCII digits not starting with 0 (except group 0) is now accepted as a numerical reference. The group name in bytes patterns and replacement strings can now only contain ASCII letters and digits and underscore.
…id in future Only sequence of ASCII digits not starting with 0 (except group 0) will be accepted as a numerical reference. The group name in bytes patterns and replacement strings could only contain ASCII letters and digits and underscore.
I'm also not sure about forbidding the leading 0
, since it feels like a special case that only makes things more complicated and inconsistent with other implementations.
When you're done making the requested changes, leave the comment: |
This PR adds restrictions without deprecation. See also #91794.
I have made the requested changes; please review again. |
Thanks for making the requested changes! @ezio-melotti: please review the changes made to this pull request. |
LGTM. Are you still planning to add a deprecation warning?
See #91794. |
What's that DO-NOT-MERGE label for |
Oh, I forget to remove it. It meant that the PR should not be merged by accident in 3.11. |
Only sequence of ASCII digits
not starting with 0 (except group 0)isnow accepted as a numerical reference.
The group name in bytes patterns and replacement strings can now only
contain ASCII letters and digits and underscore.
Closes #91760.