News for hackers. Stuff that matters.
Re:Python, Catastrophic Regular Expressions and the GIL (2013) by asicsp on Monday November 14, 2022 @07:33AM (#33593071)
The article explains that:

>On my laptop it takes about 20ms to do the search above with 16 characters - but by doubling the input string size to 32 characters, it takes over 12 minutes to finish. Exponential running time really does suck.

I checked with 32 characters on regex101, and it says "Match 1 halted after 119986 step(s)" when you click the debug icon (click the message above the regex input box).

Re:Python, Catastrophic Regular Expressions and the GIL (2013) by kmoser on Monday November 14, 2022 @10:24PM (#33604872)
I tried with PHP 7.4.6 on my PC and the results were nearly instantaneous, even with the input string more than doubled to >32 chars. What's up with that?