Notepad++ 在两行之间添加空格

时间:2021-01-12 04:22:55

标签: notepad++

我想在两条重复行之间添加四个空白字符。 我滥用了修剪跟踪空间功能,但只有一行不需要它,现在我有太多文件无法手动修复。

1    $構文名 = $SYSTEM_present_process;
2
3    SetTextWindow();

(第二行应该有四个空格)

1    $構文名 = $SYSTEM_present_process;
2    
3    SetTextWindow();

To let things more easier to understand

1 个答案:

答案 0 :(得分:0)

  • Ctrl+H
  • 查找内容:SYSTEM_present_process;\R\K(?=\R\h+SetTextWindow)
  • 替换为: # 4 个空格
  • 检查 匹配案例
  • 检查 环绕
  • 检查 正则表达式
  • 全部替换

说明:

SYSTEM_present_process;     # literally
\R                          # any kind of linebreak
\K                          # forget all we have seen until this position
(?=                         # positive lookahead, make sure we have after:
    \R                          # any kind of linebreak
    \h+                         # 1 or more horizontal spaces
    SetTextWindow               # literally
)                           # end lookahead

屏幕截图(之前):

enter image description here

屏幕截图(之后):

enter image description here