summaryrefslogtreecommitdiffstats
path: root/Lib/plat-irix6/cdplayer.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/plat-irix6/cdplayer.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/plat-irix6/cdplayer.py')
-rw-r--r--Lib/plat-irix6/cdplayer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/plat-irix6/cdplayer.py b/Lib/plat-irix6/cdplayer.py
index 5c2c95a..0e27468 100644
--- a/Lib/plat-irix6/cdplayer.py
+++ b/Lib/plat-irix6/cdplayer.py
@@ -39,8 +39,8 @@ class Cdplayer:
f = open(posix.environ['HOME'] + '/' + cdplayerrc, 'r')
except IOError:
return
- import regex
- reg = regex.compile('^\\([^:]*\\):\t\\(.*\\)')
+ import re
+ reg = re.compile(r'^([^:]*):\t(.*)')
s = self.id + '.'
l = len(s)
while 1:
@@ -49,11 +49,11 @@ class Cdplayer:
break
if line[:l] == s:
line = line[l:]
- if reg.match(line) == -1:
+ match = reg.match(line)
+ if not match:
print 'syntax error in ~/' + cdplayerrc
continue
- name = line[reg.regs[1][0]:reg.regs[1][1]]
- value = line[reg.regs[2][0]:reg.regs[2][1]]
+ name, valye = match.group(1, 2)
if name == 'title':
self.title = value
elif name == 'artist':