mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-433030: Add support of atomic grouping in regular expressions (GH-31982)
* Atomic grouping: (?>...).
* Possessive quantifiers: x++, x*+, x?+, x{m,n}+.
Equivalent to (?>x+), (?>x*), (?>x?), (?>x{m,n}).
Co-authored-by: Jeffrey C. Jacobs <timehorse@users.sourceforge.net>
This commit is contained in:
parent
2bde6827ea
commit
345b390ed6
11 changed files with 593 additions and 92 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
# update when constants are added or removed
|
||||
|
||||
MAGIC = 20171005
|
||||
MAGIC = 20220318
|
||||
|
||||
from _sre import MAXREPEAT, MAXGROUPS
|
||||
|
||||
|
|
@ -97,6 +97,9 @@ OPCODES = _makecodes("""
|
|||
REPEAT_ONE
|
||||
SUBPATTERN
|
||||
MIN_REPEAT_ONE
|
||||
ATOMIC_GROUP
|
||||
POSSESSIVE_REPEAT
|
||||
POSSESSIVE_REPEAT_ONE
|
||||
|
||||
GROUPREF_IGNORE
|
||||
IN_IGNORE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue