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 hbock
Recipients ezio.melotti, hbock, mrabarnett
Date 2013-06-11.14:40:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1370961635.12.0.751109303707.issue18190@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.7.5, running re.search on regular expressions beginning with '.+' will raise RuntimeError if:
 * the string being matched is empty
 * the flags include re.DOTALL/re.S

>>> re.search(".+a", "", flags=re.S)
  File "C:\Python27\lib\site-packages\IPython\core\interactiveshell.py", line 2731, in run_code
    exec code_obj in self.user_global_ns, self.user_ns
  File "<ipython-input-16-fefa32a418ba>", line 1, in <module>
    myre.search("")
RuntimeError: internal error in regular expression engine

This does not occur if the input string is not empty, or if re.match is used instead of re.search, or if the re.S flag is omitted.

The bug does not occur on previous versions of Python 2.x, including 2.7.4.
History
Date User Action Args
2013-06-11 14:40:35hbocksetrecipients: + hbock, ezio.melotti, mrabarnett
2013-06-11 14:40:35hbocksetmessageid: <1370961635.12.0.751109303707.issue18190@psf.upfronthosting.co.za>
2013-06-11 14:40:35hbocklinkissue18190 messages
2013-06-11 14:40:34hbockcreate