match duplicated lines more robustly

see #7