How to Remove the complete line in Notepad++
This is for those situations where you are trying to find a bunch of lines matching against some Regex and you not only want to remove that match but the line as well.
![](https://theoryit.com/wp-content/uploads/2019/05/image.png)
The regex command being used is: ^.*_.*\R
Breakdown of the command:
^ match start of line
.* match any character as many times until it sees an Underscore ( _ )
.* then again match any character as many times needed until it sees a Line Feed \R
![](https://theoryit.com/wp-content/uploads/2019/05/image-1.png)
Here you can see the Find box where I have hit count and there is 629 matches and there are 3801 lines in this document
![](https://theoryit.com/wp-content/uploads/2019/05/image-2.png)
Switched over to the Replace tab and hit Replace All and it got all 629 occurrences found.
![](https://theoryit.com/wp-content/uploads/2019/05/image-3.png)
Now as you can see there are only 3172 lines in this document meaning that those 629 lines were successfully removed from the document.