去掉文章中的千分位数字的逗号

String s = "\"The 3,234 3,5, 3242,334,532.23, 2342,34234,3234,32,23.23 = 1,321.32====23,123,3=== number is 33,223,234.35, Another number is 3,240.2, And another one is 3.2\"";
String regex = "((?<!\\d)(\\d)|(?<!\\d)(\\d{2})|(?<!\\d)(\\d{3})),(?=(\\d{3})+(?!\\d))";
Pattern pattern = Pattern.compile(regex);
log.info("{}", s);
log.info("{}", s.replaceAll(regex, "$1"));
此条目发表在java分类目录,贴了, 标签。将固定链接加入收藏夹。