更新时间:2023-12-04 20:23:22
您可以使用这个(用java风格编写,用于 replaceAll()
method):
You can use this (written in java style, to use with replaceAll()
method):
search: (?<!\\\\)(\"(?>[^\\\"]++|\\\\{2}|\\\\.)*+\"),(\\s*+})
replace: $1$2
示例:
String pattern = "(?<!\\\\)(\"(?>[^\\\"]++|\\\\{2}|\\\\.)*+\"),(\\s*+})";
String result = yourJson.replaceAll(pattern, "$1$2");