New submission from Alexander Grigoriev :
Certain patterns and input strings cause re.match to take exponentially longer
time. This can be expected because of recursive nature of matching some
patterns, but it can take surprisingly long time with some combination of a
pattern and input data o
Dennis Sweeney added the comment:
It's well-known that regular expressions can take exponential time. You can try
searching this bug tracker for "re exponential". Common suggestions are to try
a third-party module, or to write better regexes where possible. Note that the
important bits of th
Gregory P. Smith added the comment:
Try something like https://pypi.org/project/pyre2/ or _maybe_
https://pypi.org/project/regex/ (I didn't think that one tried to do a breadth
first approach though so maybe not)
I'm marking this a duplicate of the age old issue around degenerate patterns in