Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: finding whole words in a string

by mrbbking (Hermit)
on May 07, 2002 at 18:45 UTC ( #164781=note: print w/ replies, xml ) Need Help??


in reply to finding whole words in a string

Look for word breaks:

#!/usr/bin/perl -w use strict; foreach (qw(india indian indiana)){ print if /\bindia\b/; }
HTH - mrbbking


Comment on Re: finding whole words in a string
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-07-28 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (186 votes), past polls