Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by tybalt89 (Prior)
on Dec 29, 2021 at 22:07 UTC ( #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? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2022-05-17 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (68 votes). Check out past polls.

    Notices?