[Python-bugs-list] [ python-Bugs-832946 ] re.finditer() hangs with some re involving \[

SourceForge.net noreply at sourceforge.net
Thu Oct 30 05:05:42 EST 2003


Bugs item #832946, was opened at 2003-10-30 10:05
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=832946&group_id=5470

Category: Regular Expressions
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Angel Perea Martinez (angelpeream)
Assigned to: Fredrik Lundh (effbot)
Summary: re.finditer() hangs with some re involving \[

Initial Comment:
When called with some parameters (see test below),
re.finditer() enters an infinite loop.

Note that as far as I know, this is not bug 817234.  In
this case, finditer()  does NOT return anything: symply
hangs.

I work in a W2000 environment, with a fresh-installed
python v2.3.2 . That is:

sys.version_info() =  (2, 3, 2, 'final', 0)

To reproduce it:

---------------
import re

pattern = re.compile(r"\[([^][]+)+\]")

text = "[ xxxxx , xxxxxx , xxxxxx"

for n in re.finditer(pattern, text):
    print "this string will not appear"
    print n.group(0)

----------

I could'nt further simplify the pattern, neither the text.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=832946&group_id=5470



More information about the Python-bugs-list mailing list