use warnings; use strict; $_ = 'The The duplicate duplicate string string ..'; s/\b((\w)+ | (.)+) \1\b/$1/g; print "$_\n"; [download]
In reply to duplicate string with regular expression by abhishes