Skip to content
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

Merged
merged 10 commits into from
May 8, 2022

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 21, 2022

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.

Closes #91760.

…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.
Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Copy link
Member Author

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds restrictions without deprecation. See also #91794.

@serhiy-storchaka
Copy link
Member Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@ezio-melotti: please review the changes made to this pull request.

Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Are you still planning to add a deprecation warning?

@serhiy-storchaka
Copy link
Member Author

See #91794.

@serhiy-storchaka serhiy-storchaka marked this pull request as draft April 30, 2022 10:30
@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Apr 30, 2022
@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review May 8, 2022 16:06
@serhiy-storchaka serhiy-storchaka merged commit a84a56d into python:main May 8, 2022
@serhiy-storchaka serhiy-storchaka deleted the re-group-name branch May 8, 2022 16:19
@ooliver1
Copy link

ooliver1 commented May 8, 2022

What's that DO-NOT-MERGE label for

@serhiy-storchaka
Copy link
Member Author

Oh, I forget to remove it.

It meant that the PR should not be merged by accident in 3.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-regex type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More strict rules for group numbers and names in RE
4 participants