Closed GoogleCodeExporter closed 9 years ago
Usually the problem is not an infinite loop, but 'catastrophic' backtracking.
You could have an infinite loop with "()*", or 'catastrophic' backtracking with
"(.*)*".
The re module will reject some regexes that could cause a problem, and it also
performs some checks while matching, but it can still get caught out.
The regex module, on the other hand, is more lenient in what it accepts and it
performs more checks while matching, so some regexes that take a long time to
finish when using the re module will be much quicker when using the regex
module.
Because of those extra checks, I think that it's not necessary to add a
timeout, but if you come across a regex that takes much too long to finish (for
example, issue 88 and issue 89), please let me know.
Original comment by re...@mrabarnett.plus.com
on 21 Mar 2015 at 4:13
Original issue reported on code.google.com by
animaliz...@gmail.com
on 21 Mar 2015 at 2:46