Reputation: 997
Let’s say for example we have this text and I want to delete every line that containts" delete me " and also the next line using NotePad++
a random text here1111
a random text here2222
a random text here delete me3333
a random text here 4444
delete me a random text here5555
a randomtext66666
So after applying what I want , the text is gonna be like this :
a random text here1111
a random text here2222
Upvotes: 0
Views: 3187
Reputation: 91518
.*delete me.*\R.*(?:\R|$)
LEAVE EMPTY
. matches newline
Explanation:
.*delete me.* : literally "delete me" surrounded with 0 or more any character but newline
\R : any kind of line break
.* : 0 or more any character but newline
(?: : start non capture group
\R : any kind of line break
| : OR
$ : end of line
) : end group
Result for given example:
a random text here1111
a random text here2222
Upvotes: 1
Reputation: 490
You can easily do this by making a regex matching your problem.
In your case such a regex would be:
(.)*(delete me)(.)*\n(.)*
This selects the line itself and the next one. Now it is only a matter of deleting the lines corresponding to said regex why is a possibility in notepad++. (see Regex: Remove lines containing)
If you want to tweak the regex feel free to toy around with it. Regxr allows very easy tweaking and testing of any regular expression.
Upvotes: 0