]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Changed to use regex directly instead of regexp.
authorGuido van Rossum <guido@python.org>
Tue, 25 Aug 1992 12:31:03 +0000 (12:31 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 25 Aug 1992 12:31:03 +0000 (12:31 +0000)
Lib/irix5/flp.py
Lib/plat-irix5/flp.py

index fcc95f02cb9b5c16540aad0436ff11e216b29e26..39b45dcd45577efa473e6f4c6f28f108b345dda6 100755 (executable)
@@ -250,12 +250,13 @@ _parse_func = { \
 # This function parses a line, and returns either
 # a string or a tuple (name,value)
 
-import regexp
+import regex
+prog = regex.compile('^\([^:]*\): *\(.*\)')
 
 def _parse_line(line):
-    a = regexp.match('^([^:]*): *(.*)', line)
-    if not a:
+    if prog.match(line) < 0:
        return line
+    a = prog.regs
     name = line[:a[1][1]]
     if name[0] == 'N':
            name = string.joinfields(string.split(name),'')
index fcc95f02cb9b5c16540aad0436ff11e216b29e26..39b45dcd45577efa473e6f4c6f28f108b345dda6 100755 (executable)
@@ -250,12 +250,13 @@ _parse_func = { \
 # This function parses a line, and returns either
 # a string or a tuple (name,value)
 
-import regexp
+import regex
+prog = regex.compile('^\([^:]*\): *\(.*\)')
 
 def _parse_line(line):
-    a = regexp.match('^([^:]*): *(.*)', line)
-    if not a:
+    if prog.match(line) < 0:
        return line
+    a = prog.regs
     name = line[:a[1][1]]
     if name[0] == 'N':
            name = string.joinfields(string.split(name),'')