Find character ranges across multiple lines
-
My txt file has a lot of lines, each line can be any format.
How to find email addresses in the form of : abc@abschool.com , bca@school.yahoo.ca , or abc@newyork.sjshschool.email.ca … It could be another email address. I need the result that the emails have a domain that contains " school ". What am I going to do? Thanks -
So if your text is like this:
My txt file has a lot of lines, each line can be any format. How to find email addresses in the form of : abc@abschool.com , bca@school.yahoo.ca , or abc@newyork.sjshschool.email.ca … It could be another email address. I need the result that the emails have a domain that contains " school ". What am I going to do? ThanksI would do this:
Do a Mark (Ctrl+m) operation like this:

Then press Copy Marked Text and paste into a new tab:
abc@abschool.com bca@school.yahoo.ca abc@newyork.sjshschool.email.caDo another Mark operation like this:

Then right-click in the margin below the blue ball to get this menu:

and choose Copy Bookmarked Lines.
Now you have in the clipboard all of your email addresses with “school” in them.
There are other ways; although I’m trying to “keep it simple”.
-
Thank you for your quick help. It is true that I have applied your way. But there are some lines that contain " school " that are also selected. While I just want to get email results that contain a domain that contains “school.” I’m sorry I’ve asked incomplete questions.
-
For example:
school@yahoo.com
abc@gmail.com, shools are there…
These 2 lines are also selected, although I do not want to.
That’s what I want to present. -
-
Exactly. That’s great. Thanks
-
Hello, @kandice-feliciano, @alan-kilborn and All,
I initially thought of a regex, a bit more strict, regarding the e-mail address definition :
SEARCH
(?-i)\b\w([\w.]*)@[\w.]*school[\w.]*\.\w{2,}\b
However, the Alan’s regex is more elegant. And I think that we may combine the two
Markoperations in one step, with the following syntax :SEARCH / MARK
(?-i)\S+@\S*school\S+Test it, against this text :
abc@newyork.sjshschl.email.ca abc@abschool.com abc@abschol.com bca@school.yahoo.ca school@yahoo.com abc@newyork.sjshschool.email.ca bca@schoool.yahoo.ca abc@gmail.com, shools are there… abc@newyork.sjshschl.email.ca, abc@abschool.com, abc@abschol.com, bca@school.yahoo.ca, school@yahoo.com, abc@newyork.sjshschool.email.ca, bca@schoool.yahoo.ca, abc@gmail.com, shools are there…Best Regards,
guy038
-
Thank you both. Thanks to the above 2 syntax I can rely on it to find any email address with a domain that I need. Since I very often use it to find emails on drive D or E. Previously this work took me quite a lot of time and trouble. Once again thank you 2
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login