: s/\x09/\x0110\x09987654321\x02/ s/\(.\)\x01.*\1\(\x09*.\).*\x02/\2/ t s/ \S\+/&\x09/ /\x09 \x04/s/./&&/ /\x09 \x04/!s/.\x04\|$/\x04&/ T s/. 0*\x09 // T s/\x04//g
Note that non-ascii characters in the above source code will be escaped (such as \x9f).