Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Capturing regex from map

by Anonymous Monk
on Sep 14, 2013 at 06:52 UTC ( #1054061=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Capturing regex from map
in thread Capturing regex from map

Some other variants:

map { /^online.*svc:(.*?):/; $1 // () } map { /^online.*svc:(.*?):/ and $1 or () } map { /^online.*svc:(.*?):/ ? $1 : () }
The latter two are easy to extend if there are multiple captures. (The middle one is my favourite.)


Comment on Re^3: Capturing regex from map
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2014-10-01 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (29 votes), past polls