如何为所有数字和逗号组合添加新行

如何为所有数字和逗号组合添加新行

输入数据:

digit or digits comma digit or digits TEXT digit or digits comma digit or digits TEXT digit or digits comma digit or digits TEXT

结果:

digit or digits comma digit or digits TEXT 

digit or digits comma digit or digits TEXT

digit or digits comma digit or digits TEXT

输入示例:

7,8 my input text with , as well as . as well as ; and " 7,9 my input text with , and . as well as ; " and 7,10 my input text with , and . as well as ; and "

输出示例:

7,8 my input text with , as well as . as well as ; and " 
7,9 my input text with , and . as well as ; " and 
7,10 my input text with , and . as well as ; and "

答案1

  • Ctrl+H
  • 找什么:(?<=\h)(?=\d)
  • 替换为:\n\r\n取决于平台
  • 查看 环绕
  • 查看 正则表达式
  • Replace all

解释:

(?<=\h)     # positive lookbehind, make sure we have a space before
(?=\d)      # positive lookahead, make sure we have a digit after

截图(之前):

在此处输入图片描述

截图(之后):

在此处输入图片描述

相关内容