diff options
| author | Guido van Rossum <guido@python.org> | 1997-10-22 21:00:49 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1997-10-22 21:00:49 +0000 |
| commit | 9694fcab5332f27dc28b195ba1391e5491d2eaef (patch) | |
| tree | 23dc3d9a7d1cc4b138ac2bffd028a519cba93b30 /Lib/plat-irix6/flp.py | |
| parent | 426916e50e1209d8ecc12678855dc531863a48c5 (diff) | |
| download | cpython-git-9694fcab5332f27dc28b195ba1391e5491d2eaef.tar.gz | |
Convert all remaining *simple* cases of regex usage to re usage.
Diffstat (limited to 'Lib/plat-irix6/flp.py')
| -rw-r--r-- | Lib/plat-irix6/flp.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Lib/plat-irix6/flp.py b/Lib/plat-irix6/flp.py index 14e2278744..a277f7f25e 100644 --- a/Lib/plat-irix6/flp.py +++ b/Lib/plat-irix6/flp.py @@ -267,19 +267,18 @@ _parse_func = { \ # This function parses a line, and returns either # a string or a tuple (name,value) -import regex -prog = regex.compile('^\([^:]*\): *\(.*\)') +import re +prog = re.compile('^([^:]*): *(.*)') def _parse_line(line): - if prog.match(line) < 0: + match = prog.match(line) + if not match: return line - a = prog.regs - name = line[:a[1][1]] + name, value = match.group(1, 2) if name[0] == 'N': - name = string.joinfields(string.split(name),'') + name = string.join(string.split(name),'') name = string.lower(name) - name = string.upper(name[0]) + name[1:] - value = line[a[2][0]:] + name = string.capitalize(name) try: pf = _parse_func[name] except KeyError: |
