Notepad++ 在记事本中拆分一行++;[找到行中最后一个数字时拆分行]

Notepad++ 在记事本中拆分一行++;[找到行中最后一个数字时拆分行],notepad++,Notepad++,我想在记事本++中拆分一行 在找到行中的最后一个数字时希望拆分该行 例如,输入文件: 123456chennai2 6757H01 56789chju 输出: 123456 chennai2 6757 H01 56789 chju 请建议我如何实现这一点 Ctrl+H 查找内容:\d\K(?=[^\d\r\n]) 替换为:\n 检查环绕 检查正则表达式 全部替换 说明: \d : a digit \K : forget all we have s

我想在记事本++中拆分一行

在找到行中的最后一个数字时希望拆分该行

例如,输入文件:

123456chennai2  
6757H01
56789chju
输出:

123456
chennai2  
6757
H01
56789
chju
请建议我如何实现这一点

  • Ctrl+H
  • 查找内容:
    \d\K(?=[^\d\r\n])
  • 替换为:
    \n
  • 检查环绕
  • 检查正则表达式
  • 全部替换
说明:

\d          : a digit
\K          : forget all we have seen until this position
(?=         : positive lookahead, make sure we have after current position
  [^\d\r\n] : NOT a digit or line break
)           : end lookahead
\n          : linefeed, you may use "\r\n" if needed
123456
chennai2
6757
H01
56789
chju
更换:

\d          : a digit
\K          : forget all we have seen until this position
(?=         : positive lookahead, make sure we have after current position
  [^\d\r\n] : NOT a digit or line break
)           : end lookahead
\n          : linefeed, you may use "\r\n" if needed
123456
chennai2
6757
H01
56789
chju
给定示例的结果:

\d          : a digit
\K          : forget all we have seen until this position
(?=         : positive lookahead, make sure we have after current position
  [^\d\r\n] : NOT a digit or line break
)           : end lookahead
\n          : linefeed, you may use "\r\n" if needed
123456
chennai2
6757
H01
56789
chju

请添加您的代码,以便我们可以帮助您。谢谢谢谢你的回答,但是当我使用这个短语时,我得到了“零长度匹配”@susin:奇怪。您使用的是什么版本的Npp?这里它与
v7.5.6(32位)
一起使用,我也在使用同样的7.5.6 32bit@susin:可能是您没有显示文件的真实摘录,对于给定的示例,它可以正常工作。编辑您的问题并添加真实的测试用例。