本文介绍了在 Notepad++ 中查找和替换空行正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Notepad++,基本上我想使用 Notepad++ 正则表达式查找所有 不包含文本的空白行.我知道使用textfx"有一种更简单的方法可以做到这一点,但我正在寻找一种表达方式来做到这一点.以下是显示符号的示例.

I'm using Notepad++ and basically I want to find all blank lines that don't contain text using Notepad++ regex. I know that there is a simpler way of doing this by using 'textfx,' but I'm looking for an expression to do this. Here is an example below with the symbols shown.

< ?php **CRLF**
**CRLF**                        *<- REMOVE THIS*
$xxx = $_POST['xxx'];**CRLF**
$xxx = $_POST['xxx'];**CRLF**
$xxx = $_POST['xxx'];**CRLF**
**CRLF**                        *<- REMOVE THIS*
**CRLF**                        *<- REMOVE THIS*
if ($xxx)**CRLF**
{**CRLF**

推荐答案

不是正则表达式,但 Notepad++ 6.3.2 有多种方法可以在不使用正则表达式的情况下删除空行.

Not a regular expression, but Notepad++ 6.3.2 has a number of ways of removing blank lines without using a regular expression.

Menu => 编辑 => 行操作 => 删除空行

Menu => Edit => Line operations => Remove empty lines

Menu => Edit => 行操作 => 删除空行(包含空白字符)

Menu => Edit => Line operations => Remove empty lines (containing blank characters)

Menu => TextFx => TextFx Edit => 删除空行

Menu => TextFx => TextFx Edit => Delete blank lines

Menu => TextFx => TextFx Edit => 删除多余的空行

Menu => TextFx => TextFx Edit => Delete surplus blank lines

两个TextFx方法只删除空行,但可以在它们前面加上:

The two TextFx methods only delete empty lines, but they can be preceded with either of:

菜单 => 编辑 => 空白操作 => 修剪尾随空格

Menu => Edit => Blank operations => Trim trailing spaces

Menu => TextFx => vTextFx Edit** => 修剪尾随空格

Menu => TextFx => vTextFx Edit** => Trim trailing spaces

这篇关于在 Notepad++ 中查找和替换空行正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-14 02:55