0

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?

1

1 Answer 1

1

I tried this regex on your sample and it seems to work: :s/\s<[^\>]*>//g

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.