Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by Anonymous Monk
on Apr 09, 2013 at 13:43 UTC ( #1027740=note: print w/ replies, xml ) Need Help??


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

That case is a bug

See https://rt.perl.org/rt3//Public/Search/Simple.html?q=/g%20pos

If you add  scalar in front of the match, it will match regardless of //g

If you use single pair of parens  if( ) its like scalar context

Tutorials: Context in Perl: Context tutorial, "List" Is a Four-Letter Word, Easy Reference for Contexts, Mini-Tutorial: Scalar vs List Assignment Operator


Comment on Re: What does 'global' (/g) do in a regexp in this particular case? (pos bug)
Select or Download Code
Replies are listed 'Best First'.
Re^2: What does 'global' (/g) do in a regexp in this particular case? (pos bug)
by Anonymous Monk on Apr 09, 2013 at 14:17 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2015-07-07 17:36 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 (93 votes), past polls