in reply to More efficient way to truncate long strings of the same character
% perl -e'$x="aaaaaabbcccccd"; $x=~s/(.)\1{2,}/$1$1$1/g; print "$x\n"; +' aaabbcccd
-Mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: More efficient way to truncate long strings of the same character
by JavaFan (Canon) on Oct 30, 2008 at 18:34 UTC |