Notepad++ 如何在记事本+中查找以数字开头的行并将数字移动到上一行+;

Notepad++ 如何在记事本+中查找以数字开头的行并将数字移动到上一行+;,notepad++,Notepad++,例如: Rahul 1423502012 Manage 应转换为: Rahul 1423502012 Manage Rahul 1423502012 Manage 我有数千行,请帮我移动前一行末尾的号码(如1423502012)。在记事本++中,执行正则表达式查找并替换: 查找内容: ^(.*)\s+^(\d+) 替换为: $1 $2 确保取消选中“.matches newline”旁边的框。 Ctrl+H 查找内容:\R(?=\d) 替换为:(空格) 检查环绕 检查正则表达式 全部替

例如:

Rahul
1423502012
Manage
应转换为:

Rahul 1423502012
Manage
Rahul 1423502012
Manage

我有数千行,请帮我移动前一行末尾的号码(如1423502012)。

在记事本++中,执行正则表达式查找并替换:

查找内容:

^(.*)\s+^(\d+)
替换为:

$1 $2
确保取消选中“.matches newline”旁边的框。

  • Ctrl+H
  • 查找内容:
    \R(?=\d)
  • 替换为:
    (空格)
  • 检查环绕
  • 检查正则表达式
  • 全部替换
说明:

\R          : any kind of linebreak
(?=\d)      : lookahead, make sure we have a digit after current position
给定示例的结果:

\R          : any kind of linebreak
(?=\d)      : lookahead, make sure we have a digit after current position