/**
* @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");
标签:return,String,Pattern,正则,工具,null,soap,rgex From: https://blog.51cto.com/u_15836782/5775941