GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-91760: More strict rules for numerical group references and group names in RE by serhiy-storchaka · Pull Request #91792 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Apr 21, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added the awaiting core review label Apr 21, 2022
@serhiy-storchaka
pythongh-91760: More strict rules for numerical group references and …
8909d14
…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.
@serhiy-storchaka
serhiy-storchaka force-pushed the re-group-name branch from 3f533f8 to 8909d14 Compare April 21, 2022 17:04
@serhiy-storchaka
Merge branch 'main' into re-group-name
46f320d
ezio-melotti
ezio-melotti requested changes Apr 24, 2022
View reviewed changes

@ezio-melotti ezio-melotti left a comment

Copy link
Copy Markdown
Member

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'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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.11.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/re/_parser.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/re/_parser.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting core review labels Apr 24, 2022
@bedevere-bot

bedevere-bot commented Apr 24, 2022

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka added 2 commits April 24, 2022 22:22
@serhiy-storchaka
Merge branch 'main' into re-group-name
6c1a446
@serhiy-storchaka
Address review comments and minimize the diff.
5026649
serhiy-storchaka
serhiy-storchaka commented Apr 24, 2022
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member Author

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/re/_parser.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/re/_parser.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka

serhiy-storchaka commented Apr 24, 2022

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting change review and removed awaiting changes labels Apr 24, 2022
@bedevere-bot

bedevere-bot commented Apr 24, 2022

Copy link
Copy Markdown

Thanks for making the requested changes!

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot
bedevere-bot requested a review from ezio-melotti April 24, 2022 19:49
ezio-melotti
ezio-melotti approved these changes Apr 24, 2022
View reviewed changes

@ezio-melotti ezio-melotti left a comment

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting change review labels Apr 24, 2022
@serhiy-storchaka

serhiy-storchaka commented Apr 24, 2022

Copy link
Copy Markdown
Member Author

See #91794.

ezio-melotti reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka added 3 commits April 25, 2022 13:31
@serhiy-storchaka
Merge branch 'main' into re-group-name
2f486af
@serhiy-storchaka
Merge branch 'main' into re-group-name
ed09039
@serhiy-storchaka
Merge branch 're-group-name' of github.com:serhiy-storchaka/cpython i…
954ef45
…nto re-group-name
@serhiy-storchaka serhiy-storchaka added the DO-NOT-MERGE label Apr 30, 2022
@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 commented Apr 30, 2022
View reviewed changes
Comment thread Doc/whatsnew/3.11.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka serhiy-storchaka added the topic-regex label Apr 30, 2022
@serhiy-storchaka
Merge branch 'main' into re-group-name
3835c24
serhiy-storchaka added 2 commits May 8, 2022 18:24
@serhiy-storchaka
Merge branch 'main' into re-group-name
e0d2f85
@serhiy-storchaka
Update What's New
3c0dfcc
@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
@bedevere-bot bedevere-bot removed the awaiting merge label May 8, 2022
@serhiy-storchaka
serhiy-storchaka deleted the re-group-name branch May 8, 2022 16:19
@ooliver1

ooliver1 commented May 8, 2022

Copy link
Copy Markdown

What's that DO-NOT-MERGE label for

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka serhiy-storchaka removed the DO-NOT-MERGE label May 9, 2022
@serhiy-storchaka

serhiy-storchaka commented May 9, 2022

Copy link
Copy Markdown
Member Author

Oh, I forget to remove it.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hauntsaninja hauntsaninja mentioned this pull request May 18, 2022
re: 3.11 fixes python/typeshed#7859
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ezio-melotti ezio-melotti ezio-melotti approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic-regex type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

More strict rules for group numbers and names in RE

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@serhiy-storchaka @bedevere-bot @ooliver1 @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.