Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

(MeowChow) Re: Matching Words

by MeowChow (Vicar)
on May 23, 2002 at 06:15 UTC ( #168677=note: print w/ replies, xml ) Need Help??


in reply to Matching Words

Pick your poison:
  
perl -pe 's/\W*(\w+).*\W(\w+)\W*/$1 $2/' perl -ple '/(\w+).*(\b\w+)/;$_="$1 $2"' perl -ple '$_=join$",/(\w+).*(\b\w+)/' perl -ple '$_="@{[(/\w+/g)[0,-1]]}"' perl -ple '$_=join$",(/\w+/g)[0,-1]' perl -ple '@w=/\w+/g;$_="@w[0,-1]"' perl -pe '@w=/\w+/g;s/.*/@w[0,-1]/' # my personal favorite cat -n|perl -plaF\\W+ -e '$_="@F[2,-1]"'

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on (MeowChow) Re: Matching Words
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2014-10-30 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls