0: ...... Hello there. 1: ... hupa hupa ... 2: ... Hupa Hupa ... 3: ... Hupa hupa ... 4: a b cd efg egrep -i '\<([a-z]+) +\1\>' Bug_i_egrep.txt egrep -i '(\<[a-zA-Z]+) +\1\>' Bug_i_egrep.txt egrep -i huPa Bug_i_egrep.txt