t s/./X/g s/^\(.*\)\1X\{,1\}$/\1/ s/$/|/ -t s/./X/g s/^\(\(.*\)X\{,1\}\)\1$/\1/ s/^/|/\n,p