From: Fredrik Lundh Date: Sun, 2 Jul 2000 22:59:57 +0000 (+0000) Subject: - changed sre.Scanner to use lastindex instead of index. X-Git-Tag: v2.0b1~1120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=019bcb598d9b4890a105a0476b9b4e5cb9f14da7;p=thirdparty%2FPython%2Fcpython.git - changed sre.Scanner to use lastindex instead of index. --- diff --git a/Lib/sre.py b/Lib/sre.py index 79f12a1b0f45..fbf44a5f3b8d 100644 --- a/Lib/sre.py +++ b/Lib/sre.py @@ -165,7 +165,7 @@ class Scanner: p = [] for phrase, action in lexicon: p.append("(?:%s)(?P#%d)" % (phrase, len(p))) - self.scanner = sre.compile("|".join(p)) + self.scanner = _compile("|".join(p)) def scan(self, string): result = [] append = result.append @@ -178,7 +178,7 @@ class Scanner: j = m.end() if i == j: break - action = self.lexicon[m.index][1] + action = self.lexicon[m.lastindex][1] if callable(action): self.match = match action = action(self, m.group())