How Can I use grep so as to return me all matches for not only entire expression but also any part of the expression.
grep "foobar" foo
where foo contains text foo should give me a match
Why don't you simply grep on "foo". Without any flag, grep matches everything ; while the flag "-w or --word-regexp" does an exact matching.