3 ms·
>The primary virtue of these commands is that they use the Perl regular expression engine. You mean the engine that lets you write pathological regular express
by FreakLegion 14y ago
>The primary virtue of these commands is that they use the Perl regular expression engine.
You mean the engine that lets you write pathological regular expressions[1] and accidentally ReDoS[2] yourself? To be fair, it's fine if you understand how the engine works well enough to avoid these cases. But how many people can actually say this?
1. http://swtch.com/~rsc/regexp/regexp1.html http://swtch.com/~rsc/regexp/regexp1.html
2. http://en.wikipedia.org/wiki/ReDoS http://en.wikipedia.org/wiki/ReDoS
- jevinskie 14y agoI was looking into breaking a Perl IRC bot the other day and couldn't get any of the examples to work (that is, take more than a split second to execute). Does perl now detect these pathological cases and work around them or was I just not trying the examples correctly?
- FreakLegion 14y agoI believe I read somewhere that recent versions of Perl detect certain obviously pathological cases and abort them, but I don't know if they fail silently or display an error. Whether a particular needle is pathological depends on the haystack, too, so it could just be that there was a mismatch between the two in your case.