s/((.)\2*)\1$/$1/; [download]
In reply to Re: Replacing with multiple occurrences. by Skeeve in thread Replacing with multiple occurrences. by maithree