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

Re^2: position number

by Anonymous Monk
on Sep 19, 2013 at 03:27 UTC ( [id://1054767]=note: print w/replies, xml ) Need Help??


in reply to Re: position number
in thread position number

TIL:

my $re = join '|', map "($_)", qw[ab ac ad ba bla etc]; for (qw[tab act mad bar blank fetch]) { printf "%-6s %-4s %d\n", $_, $+, $#- if /$re/; }

Output:

tab ab 1 act ac 2 mad ad 3 bar ba 4 blank bla 5 fetch etc 6

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-20 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found