Search code examples
regexnotepad++

Notepad++ delete all text except email address


I have a big file with a large list of emails like:

Some Name <[email protected]>
[email protected]
Some Name3 ([email protected])
Some Name4 ([email protected])

How can I delete all other text to have only a list like:

[email protected]
[email protected]
[email protected]
[email protected]

Thanks


Solution

  • If the file contains the text which are in the above format then you could use the below regex and then replace the matched chars with empty string.

    ^.*[<(]|[>)].*
    

    DEMO