Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Match nothing in grep { ! // }

by bart (Canon)
on Mar 14, 2013 at 12:07 UTC ( #1023465=note: print w/ replies, xml ) Need Help??


in reply to Re: Match nothing in grep { ! // }
in thread Match nothing in grep { ! // }

The empty regex always matches
Well, yes, and no. // is special, it serves as a shortcut, as if it's not the first regex you match, it signifies a repeat of the last regex that matched.

perlreref:

If 'pattern' is an empty string, the last successfully matched regex is used.

In your tests here, there was no previous match, so this rule doesn't apply.


Comment on Re^2: Match nothing in grep { ! // }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2015-07-06 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (73 votes), past polls