What you want to do is globally match a something including possible repetitions, and replace what you've found with that something followed by the length of your match:
$s =~ s/((.)\2*)/$2 . length $1/eg;— Arien
Edit: It seems I misread the output you want. To only have sequences of two or more repeated letters replaced, change the star to a plus sign. (And after some sleep...) Also, you'd want to swap length $1 and $2 to have the length preceed the letter.
In reply to Re: Regexp: can I do it in one go?
by Arien
in thread Regexp: can I do it in one go?
by moxliukas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |