s/((\D)\2{1,8}|(\d)\3{0,8})/length($1).$2.$3/ge;