summaryrefslogtreecommitdiffstats
path: root/Lib/pipes.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-10-22 21:00:49 (GMT)
committerGuido van Rossum <guido@python.org>1997-10-22 21:00:49 (GMT)
commit9694fcab5332f27dc28b195ba1391e5491d2eaef (patch)
tree23dc3d9a7d1cc4b138ac2bffd028a519cba93b30 /Lib/pipes.py
parent426916e50e1209d8ecc12678855dc531863a48c5 (diff)
downloadcpython-9694fcab5332f27dc28b195ba1391e5491d2eaef.zip
cpython-9694fcab5332f27dc28b195ba1391e5491d2eaef.tar.gz
cpython-9694fcab5332f27dc28b195ba1391e5491d2eaef.tar.bz2
Convert all remaining *simple* cases of regex usage to re usage.
Diffstat (limited to 'Lib/pipes.py')
-rw-r--r--Lib/pipes.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/pipes.py b/Lib/pipes.py
index 0ae0b8c..2bb6ee3 100644
--- a/Lib/pipes.py
+++ b/Lib/pipes.py
@@ -61,7 +61,7 @@
import sys
-import regex
+import re
import os
import tempfile
@@ -124,10 +124,10 @@ class Template:
if self.steps <> [] and self.steps[-1][1] == SINK:
raise ValueError, \
'Template.append: already ends with SINK'
- if kind[0] == 'f' and regex.search('\$IN', cmd) < 0:
+ if kind[0] == 'f' and not re.search('\$IN\b', cmd):
raise ValueError, \
'Template.append: missing $IN in cmd'
- if kind[1] == 'f' and regex.search('\$OUT', cmd) < 0:
+ if kind[1] == 'f' and not re.search('\$OUT\b', cmd):
raise ValueError, \
'Template.append: missing $OUT in cmd'
self.steps.append((cmd, kind))
@@ -146,10 +146,10 @@ class Template:
if self.steps <> [] and self.steps[0][1] == SOURCE:
raise ValueError, \
'Template.prepend: already begins with SOURCE'
- if kind[0] == 'f' and regex.search('\$IN\>', cmd) < 0:
+ if kind[0] == 'f' and not re.search('\$IN\b', cmd):
raise ValueError, \
'Template.prepend: missing $IN in cmd'
- if kind[1] == 'f' and regex.search('\$OUT\>', cmd) < 0:
+ if kind[1] == 'f' and not re.search('\$OUT\b', cmd):
raise ValueError, \
'Template.prepend: missing $OUT in cmd'
self.steps.insert(0, (cmd, kind))