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

Re^3: printing LAST_MATCH_START/@- LAST_MATCH_END/@+ array where regex match begin/end

by tybalt89 (Monsignor)
on Dec 29, 2021 at 22:07 UTC ( [id://11140024]=note: print w/replies, xml ) Need Help??


in reply to Re^2: printing LAST_MATCH_START/@- LAST_MATCH_END/@+ array where regex match begin/end
in thread printing LAST_MATCH_START/@- LAST_MATCH_END/@+ array where regex match begin/end

Makes sense to me...

'abcdef' =~ /b(.)(.)./ and print "end of entire match ", $+[0], " en +d of first group ",$+[1], " end of second group ", $+[2], "\n";

outputs:

end of entire match 5 end of first group 3 end of second group 4

This is exactly as expected.

  • Comment on Re^3: printing LAST_MATCH_START/@- LAST_MATCH_END/@+ array where regex match begin/end
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-24 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found