summaryrefslogtreecommitdiffstats
path: root/Lib/rfc822.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/rfc822.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/rfc822.py')
-rw-r--r--Lib/rfc822.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 6e584eb..70ac1f8 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -38,7 +38,7 @@
# There are also some utility functions here.
-import regex
+import re
import string
import time
@@ -311,7 +311,7 @@ def unquote(str):
error = 'parseaddr.error'
-specials = regex.compile('[][()<>,.;:@\\" \000-\037\177-\377]')
+specials = re.compile(r'[][()<>,.;:@\" \000-\037\177-\377]')
def quote(str):
return '"%s"' % string.join(
@@ -408,7 +408,7 @@ def parseaddr(address):
else:
name.append(token[1])
elif token[0] == 1 and cur is addr:
- if specials.search(token[1]) >= 0:
+ if specials.search(token[1]):
cur.append(quote(token[1]))
else:
cur.append(token[1])
@@ -423,7 +423,7 @@ def parseaddr(address):
if token[0] == 2:
name.append(token[1])
elif token[0] == 1:
- if specials.search(token[1]) >= 0:
+ if specials.search(token[1]):
addr.append(quote(token[1]))
else:
addr.append(token[1])
@@ -563,4 +563,3 @@ if __name__ == '__main__':
print 'keys =', m.keys()
print 'values =', m.values()
print 'items =', m.items()
-