Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Getting characters from regex pattern

by starbolin (Hermit)
on Jun 25, 2008 at 06:51 UTC ( [id://693895]=note: print w/replies, xml ) Need Help??


in reply to Getting characters from regex pattern

This does the transformation you asked for but I'm not sure it meets your readability requirement. Certainly not the way I'd parse tokens out of a string.

$string="glarch capri foobar"; $r=q/Capri|Classic/; $string=~m/($r)/i; $r=~m/($1)/i; print $1; ... Returns 'Capri'


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found