Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Searching for regular expression overlaps

by flowdy (Scribe)
on Aug 15, 2016 at 13:05 UTC ( [id://1169794]=note: print w/replies, xml ) Need Help??


in reply to Searching for regular expression overlaps

The simplest way to achieve that (roughly) is the ad-hoc method in connection with a test suite expanded with every string that has been tested, or at least a set of them cherrypicked by a human.

Just do not stop at the first regex that matches an input, but always try to match against all regexes. If it happens that $matching_regexen > 1, you will have to roll up your sleeves in oder to apply optimisations once again, and to re-run your test suite afterwards so you make sure there are no regressions.

Guess how many strings would match against m{.}. A hypothetical program as you imagine would never finish.

  • Comment on Re: Searching for regular expression overlaps

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1169794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found