Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Compare two regex patterns

by Bloodrage (Monk)
on Mar 06, 2008 at 08:46 UTC ( [id://672400]=note: print w/replies, xml ) Need Help??


in reply to Compare two regex patterns

Actually your regular expressions are:

$exp1 = "123*"; $exp2 = "123+";

* is "any number of" the preceding character, including zero.
+ is "one or more of" the preceding character.

Hence: /x+/ == /xx*/

Apart from the pedantry, I'm afraid don't have an answer for your question.


no flames if this changed for 5.10, because that's the Perl I live in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-03-28 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found