On Mon, Apr 21, 2025 at 08:04:44 +0200, to...@tuxteam.de wrote: > If you like to disappear in rabbit holes, this [3] one is nice. If > not, still the pic at the beginning still shows impressively an > exponential runaway for Perl's re engine compared to Tcl's which > uses a Thompson algorithm. Note that this was back in 2007 and > quite possibly Perl's engine has been refined (it definitely has > been extended) since then. > > Cheers > > [3] https://swtch.com/~rsc/regexp/regexp1.html
It still has the issue. hobbit:~$ time perl -e '$s = "a" x 25; $r = "a?" x 25 . "a" x 25; if ($s =~ $r) { print "yes\n"; }' yes real 1.354 user 1.349 sys 0.004 That's with perl 5.36.0 from Bookworm.