Notepad++ RegEx delete line starting with \pard.....ending with line feed

Sarah picture Sarah · Oct 24, 2010 · Viewed 10.5k times · Source

I'm cleaning up files using Notepad ++, and trying to delete lines that start with \pard and have some text then end with a line feed. But \n doesn't work in RegEx and .* doesn't work in an extended find and replace.

This is what I've tried unsuccessfully: \pard.*\n

\pard.* works but leaves the line feed in RegEx.

Answer

J V picture J V · Nov 14, 2010
\\pard.*(\r)?\n

The question mark after the repeater is so that it isn't greedy or it will swallow most of the file including the parts it shouldn't...

Editted: Now it should handle line breaks properly

Edit: Try this

^\\pard.*$