Changed to use regex directly instead of regexp.

This commit is contained in:
Guido van Rossum 1992-08-25 12:31:03 +00:00
parent 9022fceae8
commit 354166fa05
2 changed files with 8 additions and 6 deletions

View File

@ -250,12 +250,13 @@ def _parse_numlist(str):
# 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),'')

View File

@ -250,12 +250,13 @@ def _parse_numlist(str):
# 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),'')