正则表达式提取Json数据的方法
json
适用于现代 C++ 的 JSON。
项目地址:https://gitcode.com/gh_mirrors/js/json
·
/**
* 返回json字符串中对应的值
* json json格式字符串
* regex 正则表达式
*/
public static String getParamByRex(String json, String regex) {
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(json);
String result = null;
while (matcher.find()) {
result = matcher.group(1);
}
return result;
}
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
960b763e
4 个月前
8c391e04
7 个月前
更多推荐

所有评论(0)