如何在 Notepad++ 中每隔一行添加制表符空格?

oma*_*ari 2 notepad++

我想像这样制作:

文本示例

此外,如果重要的话,该文本文档将采用 Unicode 编码。

Tot*_*oto 5

  • Ctrl+H
  • 找什么:(?:\A|\G).+\R\K(.+(?:\R|\z))
  • 用。。。来代替:\t$1
  • 检查 正则表达式
  • 取消选中 . matches newline*
  • Replace all

解释:

(?:         # non capture group
  \A        # beginning of file
 |          # OR
  \G        # restart from last match position
)           # end group
.+          # 1 or more any character but newline
\R          # any kind of linebreak (i.e. \r, \n, \r\n) 
\K          # forget all we have seen until this position
(           # group 1
  .+        # 1 or more any character but newline
  (?:       # non capture group
    \R      # any kind of linebreak (i.e. \r, \n, \r\n) 
   |        # OR
    \z      # end of file
)           # end group
Run Code Online (Sandbox Code Playgroud)

屏幕截图(之前):

在此输入图像描述

屏幕截图(之后):

在此输入图像描述