in reply to Re: Perl regexp matching is slow??
in thread Perl regexp matching is slow??
I just wanted to reiterate Peter's view - these pathological cases do come up in practice. My example is this regex, designed to find URLs in HTML documents (pathological in .NET).
href=['"]([^?'">]*\??[^'" >]*)[^>]*([^>]*)</a>
As a user, I do not want to store in my brain the knowledge of which regexes are "safe". If this knowledge is easy to describe, why not code it, and at least for this class of regexes, use the Thompson algorithm?
Of course, as an optimization that applies only for some use cases, this has to be prioritized, tested & integrated. But in a perfect PERL, I would want to see it included.
|
|---|