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