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

I agree. There is no catastrophic backtracking here (it was fixed in 
issue39503), but the complexity of matching the regular expression is linear. 
Searching the pattern in a sequence of commas has quadratic complexity, because 
every step has linear complexity and we advance only one character at every 
attempt.

The proposed solution looks correct to me and fixes the issue. Yeting Li, do 
you mind to create a pull request for it? I can do it myself, but since you 
have found the problem and the solution, it would be better if the commit be 
attributed to you.

----------

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

Reply via email to