java-利用正则表达式替换双引号中的逗号

  String s="2018-07-11,Banner,俄罗斯方块2018新版(iOS),iOS-俄罗斯方-banner,\"1,151,686\",\"1,319\",58.15,0.05,0.03%";
		   Pattern p = Pattern.compile("(\".*?),(.*?\")");
		   Matcher m = p.matcher(s);
		   StringBuffer sb=new StringBuffer();
		   while(m.find()){
			   m.appendReplacement(sb,m.group().replace(",", ""));
			   System.out.println(m.group());
		   }
		   m.appendTail(sb);
		   System.out.println(sb);

你可能感兴趣的:(java)