From 6fa0c5a452ea935977b283955a1d49e5e23d97dc Mon Sep 17 00:00:00 2001 From: Gustavo Niemeyer Date: Wed, 14 Sep 2005 08:54:39 +0000 Subject: Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than considering it exactly like a '*'. --- Lib/sre_parse.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Lib/sre_parse.py') diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index 33b399ef65..319bf43b33 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -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 = "" -- cgit v1.2.1