Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://168677]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2016-12-05 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (82 votes). Check out past polls.