Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: perl indication of end of string already matched

by Tux (Canon)
on Jun 08, 2020 at 15:41 UTC ( [id://11117825]=note: print w/replies, xml ) Need Help??


in reply to perl indication of end of string already matched

Maybe I am simplistic, but this works:

my $str = "abc"; while ($str =~ m/.(?=.|$)/gc) { say "1: ", pos $str; } while ($str =~ m/.(?=.|$)/gc) { say "2: ", pos $str; }

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

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

    No recent polls found