[issue26551] Regex.finditer infinite loops with certain input

2016-03-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is known issue. Some regular expressions has quadratic or even exponential complexity. Existing implementation can't be easy fixed. You can try an regular expressions engine that use completely different algorithms, i.e. re2 (https://pypi.python.org/pyp

[issue26551] Regex.finditer infinite loops with certain input

2016-03-13 Thread Alan Mislove
Alan Mislove added the comment: Thanks for the quick reply, Serhiy! You're right -- after letting it run for even longer, it does complete. Sorry for the trouble. I have two quick followup questions: 1. Would this be considered a performance bug? On my machine, it runs for over 20 second

[issue26551] Regex.finditer infinite loops with certain input

2016-03-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is finite loop. Your script just needs too much time to finish. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue26551] Regex.finditer infinite loops with certain input

2016-03-13 Thread Alan Mislove
New submission from Alan Mislove: I found a regex and input that causes re.finditer() to appear to get into an infinite loop. Please see the attached minimal python script that triggers the behavior. I've verified the bug exists on 2.7.6, 3.4.0, and 3.5.1; I haven't yet be able to test wheth