[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread André Fritzsche
New submission from André Fritzsche [EMAIL PROTECTED]: After struggling around with my code for nearly 1 hour now, I found out that one of my regular expressions with a special string causes python to hang up - not really hang up, because the processor usage is at nearly 100%, so I think the

[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: To optimize your query, you could remove '^.*' and '.*$', and replace match() with search(). Now it returns instantly... -- nosy: +amaury.forgeotdarc ___ Python tracker [EMAIL PROTECTED]

[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread André Fritzsche
André Fritzsche [EMAIL PROTECTED] added the comment: Thank you for this answer. It solves my problem, but I think that the issues ist still existing - or not? (The regex is running on - 3 hours now) ___ Python tracker [EMAIL PROTECTED]

[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: Are you sure your regexp will return what you want? The best match for the first part of the alternative is (14, D:\projects\retest\ver_700\modules\sapekl\__init__.py, line 21 ) The best match for the second part is

[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread André Fritzsche
André Fritzsche [EMAIL PROTECTED] added the comment: Further I was, because the upper listed string wasn't expected for this code (until it occured the first time ;-) ) Normally there has been only one occurence of (file) (.., line) or (.., line) (file) per string, so the regex did quite do

[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: Yes, this can happen. See http://www.regular-expressions.info/catastrophic.html I am sure your regexp belongs to the same category. -- resolution: - invalid status: open - closed ___ Python

[issue3128] Regex causes python to hang up? / loop infinite?

2008-06-17 Thread André Fritzsche
André Fritzsche [EMAIL PROTECTED] added the comment: Thanks for the link, it was very interesting to read what can happen in some circumstances. I think, the first two chapters can match to the problem. So the type of this issue should be feature request ;-) Never the less I learned something