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.
Alan Kilborn last edited by
TBugReporter last edited by
Thank you for your help on this.
Alan Kilborn last edited by Alan Kilborn
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
.+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.