summaryrefslogtreecommitdiff
path: root/Lib/fmt.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-10-22 21:00:49 +0000
committerGuido van Rossum <guido@python.org>1997-10-22 21:00:49 +0000
commit9694fcab5332f27dc28b195ba1391e5491d2eaef (patch)
tree23dc3d9a7d1cc4b138ac2bffd028a519cba93b30 /Lib/fmt.py
parent426916e50e1209d8ecc12678855dc531863a48c5 (diff)
downloadcpython-git-9694fcab5332f27dc28b195ba1391e5491d2eaef.tar.gz
Convert all remaining *simple* cases of regex usage to re usage.
Diffstat (limited to 'Lib/fmt.py')
-rw-r--r--Lib/fmt.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/fmt.py b/Lib/fmt.py
index f7c2718859..3f146cb589 100644
--- a/Lib/fmt.py
+++ b/Lib/fmt.py
@@ -461,9 +461,9 @@ class StdwinBackEnd(SavingBackEnd):
self.paralist[para2].invert(d, pos1, pos2)
#
def search(self, prog):
- import regex, string
+ import re, string
if type(prog) == type(''):
- prog = regex.compile(string.lower(prog))
+ prog = re.compile(string.lower(prog))
if self.selection:
iold = self.selection[0][0]
else:
@@ -474,8 +474,9 @@ class StdwinBackEnd(SavingBackEnd):
continue
p = self.paralist[i]
text = string.lower(p.extract())
- if prog.search(text) >= 0:
- a, b = prog.regs[0]
+ match = prog.search(text)
+ if match:
+ a, b = match.group(0)
long1 = i, a
long2 = i, b
hit = long1, long2