Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: What does 'global' (/g) do in a regexp in this particular case?

by hdb (Parson)
on Apr 09, 2013 at 13:37 UTC ( #1027737=note: print w/ replies, xml ) Need Help??


in reply to What does 'global' (/g) do in a regexp in this particular case?

From perlretut:

"The modifier //g stands for global matching and allows the matching operator to match within a string as many times as possible. In scalar context, successive invocations against a string will have //g jump from match to match, keeping track of position in the string as it goes along. "

If both your matching operators have /g, they become part of one operation, which can consume "Property" only once.


Comment on Re: What does 'global' (/g) do in a regexp in this particular case?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027737]
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: (12)
As of 2014-09-02 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls