正则表达式取代TAB并向上移动线

时间:2015-09-27 06:34:00

标签: regex notepad++

从这节经文的下方,我尝试删除所有标签并使用<BR>加入它们。但是我想要解开以这个经文编号开头的行。

1       I am like one who gathers summer fruit
        at the gleaning of the vineyard;
        there is no cluster of grapes to eat,
        none of the early figs that I crave.

2       The faithful have been swept from the land;
        not one upright person remains.
        Everyone lies in wait to shed blood;
        they hunt each other with nets.

3       Both hands are skilled in doing evil;
        the ruler demands gifts,
        the judge accepts bribes,
        the powerful dictate what they desire—
        they all conspire together.

在Notepad ++中找到&amp;替换,使用正则表达式我找到^\t并替换为<BR>它取代所有的TAB。但我不知道如何加入这些行,以便它会变成这样:

1       I am like one who gathers summer fruit<BR>at the gleaning of the vineyard;<BR>there is no cluster of grapes to eat,<BR>none of the early figs that I crave.
2       The faithful have been swept from the land;<BR>not one upright person remains.<BR>Everyone lies in wait to shed blood;<BR>they hunt each other with nets.
3       Both hands are skilled in doing evil;<BR>the ruler demands gifts,<BR>the judge accepts bribes,<BR>the powerful dictate what they desire—<BR>they all conspire together.

有谁能告诉我如何使用notepad ++ regex加入这些行?

1 个答案:

答案 0 :(得分:0)

以下正则表达式应该这样做。一定要选择&#34;正则表达式&#34;在搜索模式下。

 [\r\n]\s+(?![0-9])

以下是对正则表达式的解释:

[\r\n] searches for newlines
\s+ multiple spaces
(?![0-9]) discard any results that are followed by numbers