-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Grouprefs in lookbehind assertions #39322
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
Comments
I was trying to get a pattern like this to work: pat = re.compile(r'(?<=(...)\1)abc')
pat.match('jkljklabc', 6) Unfortunately, that doesn't work. The problem is that I've since discovered that both Perl and PerlRE cannot |
Logged In: YES Attached is a patch which gives GROUPREFs an arbitrary |
As part of issue bpo-2636 group references now work in lookbehinds. However, your example:
will fail but:
will succeed. Why? Well, in lookbehinds it searches backwards. In the first regex it |
I've deliberately changed the stage to patch review and the version to 3.2 to highlight the fact that a lot of work will be needed to get the new regex engine into the standard library. Feel free to change these as is seen fit. |
Can this be closed as a result of work done via bpo-2636 or must it remain open? |
Issue bpo-2636 resulted in the regex module, which supports variable-length look-behinds. I don't know how much work it would take even to put a limited fixed-length look-behind fix for this into the re module, so I'm afraid the issue must remain open. |
The patch for bpo-9179 fixes this issue too. |
New changeset fac649bf2d10 by Serhiy Storchaka in branch '2.7': New changeset 9fcf4008b626 by Serhiy Storchaka in branch '3.4': New changeset 60fccf0aad83 by Serhiy Storchaka in branch 'default': |
New changeset 0e2c7d774df3 by Serhiy Storchaka in branch '2.7': New changeset 246c9570a757 by Serhiy Storchaka in branch '3.4': New changeset b2c17681404f by Serhiy Storchaka in branch 'default': |
Now group references to groups with fixed width are supported in lookbehind assertions. |
New changeset b78195af96f5 by Serhiy Storchaka in branch 'default': New changeset 5387095b8675 by Serhiy Storchaka in branch '2.7': New changeset e295ad9be16d by Serhiy Storchaka in branch '3.4': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: