Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Testing regex equivalence

by Corion (Patriarch)
on Feb 21, 2006 at 13:19 UTC ( [id://531685]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Testing regex equivalence
in thread Testing regex equivalence

They aren't strictly equivalent, because the first regex has capturing parentheses even if they only will ever match the empty string at the end of the string. But assuming you have

/(?:.*).*$/ # and /.*$/

you could convert them into canonical form, that is, normalize all .* to become (?:.*), and then simplify, mapping (?:.*)(?:.*) to (?:.*).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2024-04-18 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found