homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author roysmith
Recipients roysmith
Date 2013年02月11日.19:39:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360611548.83.0.365452859403.issue17184@psf.upfronthosting.co.za>
In-reply-to
Content
# Python 2.7.3
# Ubuntu 12.04
import re
pattern = r"( ?P<phrase>.*)"
regex = re.compile(pattern, re.VERBOSE)
The above raises an exception in re.compile():
Traceback (most recent call last):
 File "./try.py", line 6, in <module>
 regex = re.compile(pattern, re.VERBOSE)
 File "/home/roy/env/python/lib/python2.7/re.py", line 190, in compile
 return _compile(pattern, flags)
 File "/home/roy/env/python/lib/python2.7/re.py", line 242, in _compile
 raise error, v # invalid expression
sre_constants.error: nothing to repeat
The problem appears to be that re.VERBOSE isn't ignoring the space after the "(".
Maybe this is a duplicate of issue15606 ?
History
Date User Action Args
2013年02月11日 19:39:08roysmithsetrecipients: + roysmith
2013年02月11日 19:39:08roysmithsetmessageid: <1360611548.83.0.365452859403.issue17184@psf.upfronthosting.co.za>
2013年02月11日 19:39:08roysmithlinkissue17184 messages
2013年02月11日 19:39:08roysmithcreate

AltStyle によって変換されたページ (->オリジナル) /