我想做如下例子:
此外,如果它很重要,该文本文档将采用 Unicode 编码。
答案1
- 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
屏幕截图(之前):
屏幕截图(之后):