Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: positive regex for inverted match

by hossman (Prior)
on Feb 26, 2004 at 07:24 UTC ( [id://331927]=note: print w/replies, xml ) Need Help??


in reply to Re: positive regex for inverted match
in thread positive regex for inverted match

Uh, no.

That will match every string, because "bar" 0 times is the empty string, and every input matches the empty string.

laptop:~> perl -le 'print "matches" if "bar" =~ /(bar){0}/;' matches laptop:~> perl -le 'print "also matches" if "barbar" =~ /(bar){0}/;' also matches laptop:~> perl -le 'print "event this matches" if "" =~ /(bar){0}/;' event this matches

Log In?
Username:
Password:

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

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

      No recent polls found