正则表达式如何写(替换双引号里面的逗号):
abc,"sdfs,dfs",dfds,"dfsx,sdfasd"想要的结果:abc,"sdfs@dfs",dfds,"dfsx@sdfasd"...
abc,"sdfs,dfs",dfds,"dfsx,sdfasd"
想要的结果:abc,"sdfs@dfs",dfds,"dfsx@sdfasd" 展开
想要的结果:abc,"sdfs@dfs",dfds,"dfsx@sdfasd" 展开
展开全部
正则表达式 (\".*?),(.*?\") 替换成 $1@$2
我给你一个Java语言的例子,你看看吧.
public class AA {
public static void main(String[] args) {
String s="abc,\"sdfs,dfs\",dfds,\"dfsx,sdfasd\"";
String regex="(\".*?),(.*?\")";
System.out.println(s.replaceAll(regex,"$1@$2"));
}
}
运行结果
abc,"sdfs@dfs",dfds,"dfsx@sdfasd"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询