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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://168677]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found