2016-10-06 52 views
0

你好,我需要切換在Notepad ++上的單詞位置,他們是這樣的。在Notepad ++之前和之後切換Word位置

hello word|miauw 
tommorow is nice|hhello 
work hard|world 
hello hello|day 

我想前後顛倒的單詞的相對位置的管道(|):

miauw|hello word 
hhello|tommorow is nice 
world|work hard 
day|hello hello 
+0

使用'^([^ \ n |] * \ |([^ \ n |] *)$'並替換爲$ 2 | $ 1' –

回答

0

這將做的工作:

  • 按Ctrl + H
  • 找到:^(.+?)\|(.+?)$
  • 替換爲:$2|$1
  • 更換所有

Regular expression必須進行檢查,但不. matches newline

說明:

^  : begining of line 
(.+?) : group 1, any character, 1 or more, not greedy (ie. until a ` character) 
\|  : a pipe, escaped because it has special meaning within a regex 
(.+?) : group 2 (same as group 1) 
$  : end of line