Notepad ++ Regex Ending With

jef*_*eff 4 regex replace notepad++

我想删除所有行,直到一些终止字符串.所以像这样:

These
lines 
  || that can contain numbers 123 or characters like |*{
will be removed
But the following lines
will 
remain.
Run Code Online (Sandbox Code Playgroud)

我想获得:

But the following lines
will 
remain.
Run Code Online (Sandbox Code Playgroud)

我试着搜索正则表达式/removed$/并用空字符串替换,但它说0 matches.

我怎样才能做到这一点?

谢谢你的帮助 !

Blo*_*ard 5

确保选中".匹配换行符",然后使用.*removed\.$:

请注意,您需要.*在开始时匹配所有内容,直到终止字符串,并且您必须.在结尾处转义文字.

此外,Notepad ++不希望它的正则表达式斜杠.

如果您没有.终结器的末尾,只需\.从正则表达式中删除它.

要删除尾随换行符,您也可以使用.*removed\r?\n?.

截图