You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用正则表达式将点号后的逗号分隔数字移至下一行?

拆分点号后的逗号分隔数字至新行解决方案

原始输入

0.7,511,300
Lycthythtyjhos
4,465,688
Compusrteterterterve.World
3,827,911
Penthoutrtetet
1.2,148,123
Tripgtrgtrrtg
1,716,682
Dihtyhtyhtyh
01.1,115,456
Nov1995

期望输出

0.
7,511,300
Lycthythtyjhos
4,465,688
Compusrteterterterve.World
3,827,911
Penthoutrtetet
1.
2,148,123
Tripgtrgtrrtg
1,716,682
Dihtyhtyhtyh
01.
1,115,456
Nov1995

正确正则表达式方案

用以下规则匹配替换,可精准拆分目标内容,同时保留日期行(如Nov1995)不变:

Find What:

^(\d+\.)(\d{1,3}(?:,\d{3})+)$

Replace With:

$1\r\n$2

规则说明

  • ^(\d+\.):匹配行首的数字序列+点号,捕获为分组1(例如0.、1.、01.)
  • (\d{1,3}(?:,\d{3})+)$:匹配点号后紧跟的逗号分隔数字格式(例如7,511,300),捕获为分组2且限定为行尾内容
  • 替换时将两个分组用换行符分隔,实现拆分效果
  • 日期行不满足“数字+点号+逗号分隔数字”的格式,不会被匹配修改

内容的提问来源于stack exchange,提问作者abolfazl joghori

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 06:53:22