Replace repeated item with the number of times it is repeated
Hello, is there a way to replace a character or a string, repeated continuously N times, with the number N?
Say, replace "AA" with "2", "AAA" with "3" and so on, in just one regular expression?
Thank you.
|