2015-09-27 52 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

作品,正是因爲它應該,再加上明確的解釋。 –