Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: The 'g' modifier in compiled regex

by japhy (Canon)
on Apr 09, 2007 at 03:24 UTC ( #608926=note: print w/replies, xml ) Need Help??


in reply to The 'g' modifier in compiled regex

The /g modifier is an attribute of the pattern matching action, not the regex itself.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: The 'g' modifier in compiled regex
by bart (Canon) on Apr 09, 2007 at 09:23 UTC
    Likewise, the /e modifier is a modifier for the substitution step of s///, which is even one step further away from the regex (qr//) than /g, so that even m//can't use it.

    In Javascript, that borrowed a lot from Perl, the /g is indeed attached to the regex for replace , but IMnsHO, that was a design mistake. It should have been a property, or a separate parameter, of replace.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://608926]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2016-12-02 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (51 votes). Check out past polls.