Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than

considering it exactly like a '*'.
This commit is contained in:
Gustavo Niemeyer 2005-09-14 08:54:39 +00:00
parent 0c55f2946b
commit 6fa0c5a452
3 changed files with 10 additions and 0 deletions

View file

@ -485,6 +485,9 @@ def _parse(source, state):
elif this == "+":
min, max = 1, MAXREPEAT
elif this == "{":
if source.next == "}":
subpatternappend((LITERAL, ord(this)))
continue
here = source.tell()
min, max = 0, MAXREPEAT
lo = hi = ""