perl -nle'print$1?("$1 repeated ",length($&)/length$1," times"):$&while/(\w+?)\1+|./g'