s/(.)\1\1\K\1*//g;
Shouldn't \1* in regex above be \1+ for reason similar to that discussed in Re^3: Supress similar chars in the string: useless replacement of empty string with empty string? (Or is regex engine smart enough to avoid this null operation?)
In reply to Re^3: Supress similar chars in the string
by AnomalousMonk
in thread Supress similar chars in the string
by Lana
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |