Reputation: 920
So, so I have this in some file:
ABCxxx.yyyDEF
and I want to change it to be:
HELLOxxx.yyyWORLD
Is there a way to do this? / How?
I was playing with using wildcards, e.g.
:%s/ABC.*DEF/HELLO.*WORLD/g
but, .* in the replaced HELLO_WORLD doesnt save the replaced .* characters. It just comes out as HELLO.*WORLD
Help appreaciated,
Pachun
Upvotes: 0
Views: 146
Reputation: 7922
s/ABC\(xxx.yyy\)WORD/JJJ\1MOO/
Whatever is in \(\) will be remembered and can be used in the replacement string.
Upvotes: 3