Vim Regex to replace tags
Posted
by
Rudiger Wolf
on Programmers
See other posts from Programmers
or by Rudiger Wolf
Published on 2012-04-16T08:50:55Z
Indexed on
2012/04/16
11:44 UTC
Read the original article
Hit count: 1146
I am lookin for a regex express to remove the email addresses from a text file.
Input file:
Hannah Churchman <[email protected]>; Julie Drew <[email protected]>;
Output file:
Hannah Churchman; Julie Drew;
I thought a generic regex shuch as s/<(.*?)>//g would be a good starting point but I am unable to find the right expression for use Vim?
something like
:%s/ <\(.*?\)>//g
does not work. Error is "E486: Pattern not found:".
:%s#[^ <]*>##g almost works but it leaves the space and < behind.
:%s# <##g to remove the " <" remaining stuff.
Any tips on how to better craft this command?
© Programmers or respective owner