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
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]
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]
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
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
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
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