Notepad++: Delete A line before and After of Specific Word in Files
-
Hello I’m Trying to
Delete A line before and After a Word “IncorrMail” in my Documents Using Notepad++
Like
portgenerous3@hotmail.com:iiNUiwZ7B
portgenerous3@hotmail.com:PZn7O5Rc9toh:2024-05-19falconboules@hotmail.com:Lavine1986
IncorrMailpillarpitcher@hotmail.com:gy824SF4Jb
pillarpitcher@hotmail.com:F8wuOixPTS8l4:2024-05-19beforebark52@hotmail.com:537EOUDsc537
IncorrMailrondeauwendy42@hotmail.com:965nrgoyct96
IncorrMail====================
On Above I want to remove a Line Before & After of Word IncorrMail
i’m finding solution from last 10 days but still not getting
please help me with Regax
How can i do it?
-
Try:
Find:
(?-si)^.*\R(.*?IncorrMail.*\R).*\R
Replace:${1}
Search mode: Regular expression -
@Alan-Kilborn said in Notepad++: Delete A line before and After of Specific Word in Files:
${1}
Thanks For The Reply
I Tried Your Solution of Find Regax It’s Working But when i tried to Replace its’s not working
i’m attaching the error screenshot
(
image url)
-
I Tried Your Solution of Find Regax It’s Working But when i tried to Replace its’s not working
It appears you did a Find All in Current Document. For this search to find hits it doesn’t matter what the current caret position is.
When you tried replace, your caret was further down in the file and no hits occurred between the position of the caret and the file’s end (the error message told you this: no occurrence was found from caret to end-of-file).
Solution for replace: Either move the caret to the top of the file (Ctrl+Home), or checkmark the Wrap around checkbox, before pressing Replace.