Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

It ends, but it tooks several minutes to complete.

It is a limitation of the regular expression implementation in Python. Your 
input contains a sequence of 588431 characters which match the pattern 
[a-zA-Z0-9_.+-] not following by '@'. The engine finds the first character in 
this sequence, then scans 588431 characters matching this pattern, but does not 
find '@' after them. So it backtracks, steps back by one character and tries to 
match '@', fails, and continue stepping back until returns to the initial 
character. 588431 steps forward and 588431 steps back are needed to find that 
no matches starting at this position. So it steps forward and try the 
proce3dure from a new position. No it does 588430 steps in both direction. 
Totally it needs to do 588431+588430+588429+...+1 ~ 588431**2/2 ~ 173e9 steps. 
It takes a long time.

----------

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

Reply via email to