perl -ne 'print if /\bfoo\b/' in.txt [download]
If that's not it, start with a better problem statement.
In reply to Re: word finder by Fletch in thread word finder by fxmakers