Want REGEX to Check Every Line Indivdually
-
I have Notepad++ document with an email address on each line. I want to replace the ampersand and everything before it, so I am left with just the domain of each email address. When I search with the expression “<[^@]+?@” and replace with blank, the entire document is cleared. How do I get Notepad++ search each line individually?
Thanks for any ideas on this.
-
(?-s)^.+?@ -
@kc270000 said in Want REGEX to Check Every Line Indivdually:
the ampersand
“&”?
The mind boggles. 😁
-
Thank you for your help on this.
-
@TBugReporter said in Want REGEX to Check Every Line Indivdually:
The mind boggles. 😁
Meant “at” typed ampersand. Thankfully Alan understood…
-
@kc270000 said in Want REGEX to Check Every Line Indivdually:
Meant “at” typed ampersand. Thankfully Alan understood…
Actually I think I glossed over ampersand and my eyes flew right to the non-working regex you provided – and I went from there quickly to the solution.
:-)BTW, (maybe) the reason the OP’s regex cleared the entire document is that the regex didn’t contain anything to limit the match to each line. Typically this is done with
(?-s)in combination with.*or.+later in the expression. Without a., and without any line-ending characters in the regex, it will match across lines and perhaps even consume the entire doc.
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