Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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: (12)
As of 2015-07-30 17:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls