Having a file, for example, an extraction from your mailbox, and you want to extract only the email addresses? Using Notepad++ and simple regular expression, that’s pretty simple. See below a full example, or, to summarize, open your file, use the below regexp to find email addresses, add line breaks before and after each of them, and then mark the lines containing an email address and delete the unmarked lines.
Given the following text file as input, there are 3 easy steps to follow so that you can extract all email addresses contained inside the text.
Text containing email addresses
1st Step – Find Email Addresses Using Regex Match:
Use the find & replace feature of notepad++
This adds and new line before and after each email address as shown below.
Email address in a new line
Step 2 – Mark Email Addresses And Bookmark Lines
have “Bookmark Line” checked.
Step 3 – Remove Unmarked Lines
Search > Bookmark > Remove Unmarked Lines
Remove unmarked lines in Notepad++
That’s all we have. We hope that you liked this article. If you have any problem with this code while using then feel free to contact us with a full explanation of your problem. We will reply to you as time allows us or If you have any doubts and problems please comment below. We are happy to help you! If you liked this article, Don’t forget to share this with your friends so they can also take benefit from it and leave your precious feedback in our comment form below. Happy development, See you in the next article.