我如何才能找到/替换所有CR/LF字符在notepad++ ?

我正在寻找一些相当于微软Word中的^p特殊字符。


当前回答

也许你可以使用TextFX插件

在TextFX中,点击TextFX编辑→删除空行

其他回答

要找到任何类型的换行序列,请使用以下正则表达式结构:

\R

要查找和选择连续的换行序列,在\R: \R+后添加+。

确保你打开了正则表达式模式:

它匹配:

U+000DU+000A -CRLF '序列 U+ 000a -换行,lf U+ 000b -行制表,vt U+ 000c -形式馈电,ff U+ 000d -回车,cr U+0085 -下一行,nel U+2028线分隔器 U+2029段分隔符

只需在find中执行\r,并在replace字段中使用空白进行替换,这样所有内容都将上升到一行。然后执行查找和替换(在我的例子中是分号)并替换为;\n

:) -条款和条件

做这个设置。菜单->视图->显示符号->取消勾选显示行结束

CRLF图像


不含CRLF的图像

这似乎是一个常见问题,提供的解决方案是:

Simple search (Ctrl+H) without regexp You can turn on View/Show End of Line or view/Show All, and select the now visible newline characters. Then when you start the command some characters matching the newline character will be pasted into the search field. Matches will be replaced by the replace string, unlike in regex mode. Note 1: If you select them with the mouse, start just before them and drag to the start of the next line. Dragging to the end of the line won't work. Note 2: You can't copy and paste them into the field yourself. Advanced search (Ctrl+R) without regexp Ctrl+M will insert something that matches newlines. They will be replaced by the replace string.