2015-09-27 65 views
-1

从下面的诗我尝试删除所有选项卡,并加入他们使用<BR>。但我想解开以诗句开头的线条。正则表达式替换TAB并向上移动

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.

在记事本++找到&更换,使用正则表达式我觉得^\t<BR>替换替换所有的标签。但我不知道如何加入的线,所以它会变成这个样子:

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.

谁能告诉我如何加入使用记事本+ +正则表达式的行?

回答

0

以下正则表达式应该这样做。确保在搜索模式下选择“正则表达式”。

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

这里的正则表达式的解释:

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

作品,正是因为它应该,再加上明确的解释。 –