: s/[1-9]/-&-----/g y/123456789/012345678/ t s/-\{8\}/=/ s/-\(0=*\)/\1----------/ t s/=\(\|---\|------\?\)$// :3 s/=/<<123456789=01>/ s/\(.\)<.*\1\(=*.\).*>-*/\2/ t3
Note that non-ascii characters in the above source code will be escaped (such as \x9f).