<created>
pat@c.com
</created>
I want to replace the above with but the username may vary i.e,pat@c.com ,harry@c.com...
<created>
tom@c.com
</created>
What is the command to replace this in vim
%s/<created>\r*\r</created>/new string
It worked for me like this:
If you wanted to re-insert the e-mail address you can use:
A bit of explanation:
\n
: newline\s
: spaces and tabs\w
: any word character\(
and\)
: capture what's inside\1
: use the first captured expression