http://qs1969.pair.com?node_id=1154096


in reply to How to remove all repeating characters in a string in place

s/(.)\g1+//g
It's all pretty much in the Perl regex tutorial although a little background and experience with regexes may help.
Ron