Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Value of $_ inside a regex (?{ code })

by Anonymous Monk
on Oct 12, 2015 at 08:10 UTC ( [id://1144488]=note: print w/replies, xml ) Need Help??


in reply to Re: Value of $_ inside a regex
in thread Value of $_ inside a regex

Aha, so we're talking about a specific construct, the http://perldoc.perl.org/perlre.html#%28?{-code-}%29, which says
inside a (?{...}) block, $_ refers to the string the regular expression is matching against. You can also use pos() to know what is the current position of matching within this string.
  • Comment on Re^2: Value of $_ inside a regex (?{ code })

Replies are listed 'Best First'.
Re^3: Value of $_ inside a regex (?{ code })
by Discipulus (Canon) on Oct 12, 2015 at 08:27 UTC
    so that part is documented; good to know.

    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^3: Value of $_ inside a regex (?{ code })
by AnomalousMonk (Archbishop) on Oct 12, 2015 at 20:16 UTC

    I see this statement in the documentation of  (?{...}) in perlre back to 5.8.9. But nothing like it for  (??{...}) Interesting.


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-23 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found