% perl -e'$x="aaaaaabbcccccd"; $x=~s/(.)\1{2,}/$1$1$1/g; print "$x\n"; +' aaabbcccd
-Mark
In reply to Re: More efficient way to truncate long strings of the same character
by kvale
in thread More efficient way to truncate long strings of the same character
by kurtis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |