Help for this page

Select Code to Download


  1. 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":""}'
    
  2. 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' : ''
    }
    
  3. or download this
    perl -wlne 'while(s/(\w+?)\1+//){print$`if$`;@L=split"(?=$1)",$&;print
    +f"%s repeated %i times\n",$1,$#L+1}'