Extract email please
I have text file with 1000 lines. I wanted to extract those emails example:
DJM4@gmail.com:marakkakaka —“last_name”: “Dharmani”
Da89@gmail.com:qwsgshs “uid”: 14429319
please I need your help, eternally grateful
wanted to extract
I see from your small number of examples that there appears to be a number of different delimiters, namely
spacecharacter. My regular expression has catered for these, however if there are others you will need to add them. I will show you where.
So the Replace function is used
This is a regular expression so the search mode is ‘regular expression’. You can click once on the ‘replace all’ once setup and it will work on the entire file.
By way of explanation:
(?-s)means we only operate on 1 line at a time.
^refers to the start of the line.
Everything inside of the
()is what we keep and
\1in Find What refers to that.
.+?:means take as few characters as possible up to the first
:character and together with the
contents means we capture exactly what’s needed.
[^;, ]+means capture characters so long as we
don'tencounter one of the following,
space. So if you have any further delimiters you need to place them inside of the
.+captures the rest of the line and since it’s not inside the `() it is lost/deleted.
So for me it worked exactly as you requested on the examples provided. So it’s only as good as the data you provided. Any deviation or exceptions in your data will likely cause a bad result.
eternally thank you my friend