From 212861c54fe7e3d3b43f27fdbdaedb453731dbe9 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 5 Feb 2008 17:32:15 +0000 Subject: [PATCH] In the experimental 'Scanner' feature, the group count was set wrong. --- Lib/re.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/re.py b/Lib/re.py index d7151543f00..1d9c987c1cd 100644 --- a/Lib/re.py +++ b/Lib/re.py @@ -300,8 +300,8 @@ class Scanner: p.append(sre_parse.SubPattern(s, [ (SUBPATTERN, (len(p)+1, sre_parse.parse(phrase, flags))), ])) + s.groups = len(p)+1 p = sre_parse.SubPattern(s, [(BRANCH, (None, p))]) - s.groups = len(p) self.scanner = sre_compile.compile(p) def scan(self, string): result = []