Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Getting characters from regex pattern

by starbolin (Hermit)
on Jun 25, 2008 at 06:51 UTC ( #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? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2022-10-02 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (8 votes). Check out past polls.

    Notices?