A
A
Artyom2019-08-20 18:56:45
Regular Expressions
Artyom, 2019-08-20 18:56:45

How to find email using regular expression and remove the rest in txt?

Let's use a REGEX to search for EMAIL: .*?([a-zA-Z0-9._%+-][email protected][a-zA-Z0-9.-]+\.[a-zA-Z]{2, 6})
or
^([a-z0-9_\.-]+)@([a-z0-9_\.-]+)\.([az\.]{2,6})$
But how to do , so that everything that does not match this expression is deleted and only the email list is displayed.
In the example

text text text text text text text text text text text text text text text text text text
text text text text text text text
text text text text
d1t01 - trackname
d1t02 - trackname
d1t03 - trackname
d1t04 - trackname
d1t05 - trackname
d1t06 - trackname
d1t07 - trackname
d1t08 - trackname
d1t09 - trackname
d1t10 - trackname
d1t11 - trackname
text text text text
text text text text text text text text
text text text text text text text text text text text text

The command worked
Find: ^(?!d\w+).*\r?\n?
replace:

How can I apply this to my problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-08-20
@dodo512

Notepad++
This template is applied in the search on the notes tab.
Then the menu Search >> Bookmarks >> Copy all lines with a bookmark. Or delete all lines without a bookmark.
5d5c1e30aed0d025846766.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question