- or download this
perl -Mstrict -wlne 'while(s/(\w+?)\1+//){print$`if$`;my@L=split"(?=$1
+)",$&;printf"%s repeated %i time%s\n",$1,$#L+1,$#L?"s":""}'
- or download this
while(s/(\w+?)(\1+)//) {
print $` if $`;
my @L = split "(?=$1)", $&;
printf "%s repeated %i time%s\n", $1, $#L+1, $#L ? 's' : ''
}
- or download this
perl -wlne 'while(s/(\w+?)\1+//){print$`if$`;@L=split"(?=$1)",$&;print
+f"%s repeated %i times\n",$1,$#L+1}'