Notepad++ Delete Lines with Find & Replace

find and replacenewlinesnotepad

Does anyone know how to delete a line using Find & Replace in Notepad++ ?

In my Find query it finds the proper lines okay: ^.pPrev.$
In the Replace field, I leave it blank thinking the line should deleted (i.e. replaced with nothing), but the newline and endline characters remain.

Best Answer

Use the "Extended" setting in the Replace window (not "Regular expression": I'm sure there's a way to do it with Regular expression, but using "Extended" works fine).
Enter ".pPrev.\r\n" in the "Find what" field, and leave the "Replace what" field blank. This will include the \r\n characters in the match and delete the whole line.