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