gpt4 book ai didi

regex - Notepad++ 换行正则表达式问题

转载 作者:行者123 更新时间:2023-12-01 08:17:46 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:




10年前关闭。




Possible Duplicate:
Find CRLF in Notepad++



我正在尝试使用 notepad++ 进行一些简单的正则表达式查找和替换。但是,当我尝试对新行使用正则表达式语法 (\r\n) 时,出现以下错误:

can't find the text: "\r\n"



\r\n 适用于“扩展”搜索和其他文本编辑器,但不适用于正则表达式搜索。

有任何想法吗?

最佳答案

Notepad++ 的正则表达式引擎不支持多行,所以换行符无法匹配。如果需要查找和替换空行,则需要使用扩展搜索。从 Notepad++ 6.0 起不再如此,它现在使用 PCRE 作为其正则表达式引擎并允许多行替换。见 the accepted answer to the duplicate question了解更多信息。

关于regex - Notepad++ 换行正则表达式问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6309884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com