New submission from Eric Promislow:

>>> import re
>>> p = re.compile(r'^(?:\\"|.|)*?"', re.S|re.M)
>>> s = 'sub foo {\n\tprint "\n\t\tbar\n\t\t";\n}\n'
>>> m = p.findall(s)

Python doesn't return.

Dropping the last "|" in the pattern fixes this.

Regex engines in Perl, PHP, JS, and Ruby all handle
this regex.  Ref Komodo bug http://bugs.activestate.com/show_bug.cgi?id=98268

----------
messages: 185474
nosy: ericp
priority: normal
severity: normal
status: open
title: re: Infinite loop with repeated empty alternative
type: enhancement
versions: Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17568>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to