[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-03-31 Thread Alexander Grigoriev
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

[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-03-31 Thread Dennis Sweeney
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

[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-04-11 Thread Gregory P. Smith
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