http://qs321.pair.com?node_id=1036484


in reply to Re^4: Remove duplicate from the same line..
in thread Remove duplicate from the same line..

You are not very open to experimentation, are you?

use strict; use warnings; my $str = "Goldman Sachs Group, ... Goldman Sachs Group, Inc."; $str =~ s/ \b (.+) \b [,.\s]* \1.* /$1/gx; print "$str\n";