I have a file with text that looks like
{\o H}{\o e}{\o l}{\o l}{\o o} {\o W}{\o o}{\o r}{\o l}{\o d}
I want the text to look like this
{\o Hello} {\o World}
There are probably several tools that I can use to solve this problem, but I'm trying to use vim lookups. I still have
:%s/{\\o \(.\{-}\)}{\\o \(.\{-}\)}/{\\o \1\2}/g
Templates here
.\{-} match some non greedy characters
{\\o .\{-}}match regex string {\o .*}but not greedy with.*
and \( ... \)creates capture groups for the callback.
When I run this replacement once, I get
{\o He}{\o ll}{\o o} {\o Wo}{\o rl}{\o d}
I can run this command two more times to get
{\o Hell}{\o o} {\o Worl}{\o d}
and then
{\o Hello} {\o World}
, , , vim , . , .
- , , ? , . , - ?