Convert all remaining *simple* cases of regex usage to re usage.

This commit is contained in:
Guido van Rossum 1997-10-22 21:00:49 +00:00
parent 426916e50e
commit 9694fcab53
23 changed files with 134 additions and 144 deletions

View file

@ -5,7 +5,6 @@
import rfc822
import os
import regex
class _Mailbox:
def __init__(self, fp):
@ -117,12 +116,13 @@ class MmdfMailbox(_Mailbox):
class MHMailbox:
def __init__(self, dirname):
pat = regex.compile('^[0-9][0-9]*$')
import re
pat = re.compile('^[0-9][0-9]*$')
self.dirname = dirname
files = os.listdir(self.dirname)
self.boxes = []
for f in files:
if pat.match(f) == len(f):
if pat.match(f):
self.boxes.append(f)
def next(self):
@ -187,6 +187,7 @@ def _test():
if not msg:
break
msgs.append(msg)
msg.fp = None
if len(args) > 1:
num = string.atoi(args[1])
print 'Message %d body:'%num