01(1),02(6),03(5),04(6),05(7),06(3)
需求:括号前数值作为参数,获取括号里的值
String month = "02";
Matcher matcher = Pattern.compile(month+"\\(.*?\\)").matcher("01(1),02(6)");
if(matcher.find()) {
String s = matcher.group(0).replaceAll(month + "\\(", "").replaceAll("\\)","");
System.out.println(s);
}
如有更好的办法欢迎留言!!!