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.