开发者

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

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.


\\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.*$


do you mean exactly "\pard" or "\p"ard? If it's the first then you need to escape the "\" with another "\".

\\pard.*\n

You may also need to look at the new line character actually being a pc format which is \r\n

\\pard.*\r\n
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜