标签:表达式 find 正则 new system 表达 compile stat param
/**
* 正则表达式匹配两个指定字符串中间的内容
* @param soap
* @return
*/
public static List<String> getSubUtil(String soap, String rgex){
List<String> list = new ArrayList<String>();
Pattern pattern = Pattern.compile(rgex);// 匹配的模式
Matcher m = pattern.matcher(soap);
while (m.find()) {
int i = 1;
list.add(m.group(i));
i++;
}
return list;
}
==========================
String regs = "\"actId\":\"(\\d+)\"";
List<String> subUtil = getSubUtil(s, regs);
System.out.println(subUtil);
标签:表达式 find 正则 new system 表达 compile stat param
原文地址:http://blog.51cto.com/357712148/2347049