-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-100061: Restore the global Input Stream pointer #102612
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
Conversation
uyw4687
commented
Mar 11, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Extra characters erroneously matched when using possessive quantifier with negative lookahead #100061
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.
Please add a new entry that describe the fix to user.
Such as: Fix wrong match in postive qualifiers. Patch by <your name>
Lib/test/test_re.py
Outdated
@@ -2303,6 +2303,8 @@ def test_possessive_quantifiers(self): | |||
self.assertIsNone(re.match("^x{}+$", "xxx")) | |||
self.assertTrue(re.match("^x{}+$", "x{}")) | |||
|
|||
self.assertEqual(re.match('((.(?!C))++)', 'ABCD').span(), (0, 1)) |
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.
You may add a comment # gh-100061
for this test-case.
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.
Thanks, added :)
IMO the fix is fine. Just adjust some details (comment/new_entry). |
@ezio-melotti, @serhiy-storchaka (as regex experts) |
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.
Thanks @uyw4687 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @uyw4687 and @serhiy-storchaka, I could not cleanly backport this to |
Sorry, @uyw4687 and @serhiy-storchaka, I could not cleanly backport this to |
…essive quantifiers (pythonGH-102612) Restore the global Input Stream pointer after trying to match a sub-pattern. Co-authored-by: Ma Lin <[email protected]>. (cherry picked from commit abd9cc5) Co-authored-by: SKO <[email protected]>
GH-108003 is a backport of this pull request to the 3.12 branch. |
…essive quantifiers (pythonGH-102612) Restore the global Input Stream pointer after trying to match a sub-pattern. Co-authored-by: Ma Lin <[email protected]>. (cherry picked from commit abd9cc5) Co-authored-by: SKO <[email protected]>
GH-108004 is a backport of this pull request to the 3.11 branch. |
|
… quantifiers (GH-102612) (GH-108004) Restore the global Input Stream pointer after trying to match a sub-pattern. Co-authored-by: Ma Lin <[email protected]> (cherry picked from commit abd9cc5) Co-authored-by: SKO <[email protected]>
… quantifiers (GH-102612) (#108003) Restore the global Input Stream pointer after trying to match a sub-pattern. . (cherry picked from commit abd9cc5) Co-authored-by: SKO <[email protected]>