@array=('a.b','a'); @result=grep (/\ba\b/,@array); print $_."\n"for(@result); #### Result:- a.b a