如字符串:"asdasd:"123" , a:"null""
替换成"asdasd:"123" , a:null"
------解决方案--------------------
String str_content = "\"asdasd:\"123\" , a:\"null\"\"";
String model="";
Pattern pattern2 = Pattern.compile("a:\"null\"\"");
Matcher matcher2 = pattern2.matcher(str_content);
if (matcher2.find()) {
model=matcher2.replaceAll("a:null\"");
}
自己仔细想下替换规则
------解决方案--------------------
String str_content = "asdasd:\"123\" , a:\"null\"";
String model="";
Pattern pattern2 = Pattern.compile(":\"null\"");
Matcher matcher2 = pattern2.matcher(str_content);
if (matcher2.find()) {
model=matcher2.replaceAll(":null");
}
System.out.println(model);
}