Could someone tell me why:
>>> import re
>>> p = re.compile('\\.*\\(.*)')

Fails with message:

Traceback (most recent call last):
  File "<pyshell#12>", line 1, in <module>
    re.compile('\\dir\\(file)')
  File "C:\Python25\lib\re.py", line 180, in compile
    return _compile(pattern, flags)
  File "C:\Python25\lib\re.py", line 233, in _compile
    raise error, v # invalid expression
error: unbalanced parenthesis

I thought '\\' should just be interpreted as a single '\' and not
affect anything afterwards...

The script 'redemo.py' shipped with Python by default is just fine
about this regex however.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to