我正在尝试使用 Notepad++ 查找和删除一行
我需要在此文件(UNIX 格式)中找到与字符串'#RedirectMatch Permanent匹配的'行并删除该行。
有谁知道如何使用 Notepad++ 查找和替换来做到这一点?
谢谢和亲切的问候,
步骤1
Search→ Find→(转到选项卡)MarkFind what: ^会话。*$ Bookmark lineRegular expression(在 下Search Mode)Mark All(这将找到正则表达式并突出显示所有行并将它们添加为书签)第2步
Search→ Bookmark→Remove Bookmarked Lines如果它支持标准正则表达式...
find:
^.*#RedirectMatch Permanent.*$
replace:
什么都换。
在搜索对话框中提供以下内容:
查找内容: ^$\r\n
替换 为:(留空)
点击Replace All
使用“全部替换”功能,您可以通过以下方式直接删除一行:
$\n? $(\r\n)?例如,在您的情况下:
.*#RedirectMatch Permanent.*$\n?