/**
* @param : [soap, rgex]
* @description : 返回指定字符中间的字符串
*/
public static String getSubUtilSimple(String soap, String rgex) {
if (soap == null) {
return null;
}
Pattern pattern = Pattern.compile(rgex);// 匹配的模式
Matcher m = pattern.matcher(soap);
if (m.find()) {
return m.group(1);
}
return "";
}
}
getSubUtilSimple(result, "CurrConns:\\s(.*?)\\s");
本文已参与「新人创作礼」活动,一起开启掘金创作之路