Newer Perls (>=5.10) also allow you to say
s/(.)\1\1\K\1*//g;
i.e., through the use of \K, you don't need to copy the part of the match you want to keep ($1 in your regex) into the substitution.
In reply to Re^2: Supress similar chars in the string
by Anonyrnous Monk
in thread Supress similar chars in the string
by Lana
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |