[issue23541] Re module's match() fails to halt on a particular input

Matthew Barnett report at bugs.python.org
Fri Feb 27 22:31:54 CET 2015


Matthew Barnett added the comment:

The problem is with the "(\w+\s*)+". \s* can match an empty string, so when matching a word it's like "(\w+)+".

If you have n letters, there are 2**n ways it could match, and if what follows never matches, it'll try all of them.

It _will_ finish, eventually...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23541>
_______________________________________


More information about the Python-bugs-list mailing list