in reply to Replacing with multiple occurrences.

sure
s/((.)\2*)\1$/$1/;

Replies are listed 'Best First'.
Re: Re: Replacing with multiple occurrences.
by perlguy (Deacon) on May 08, 2003 at 16:02 UTC

    This wasn't tested, I assume, as it doesn't work as requested. Try it with my string below.

    Update: To clarify: 'aaabcdabcddddddefgg' would become 'aaabcdabcddddddefg' using your version.

    Update 2: Oops. I misread the question as 'all' duplicates in the string. Thanks to physi for pointing out my fault. Interesting exercise, anyway.