日期:2014-05-20 浏览次数:20800 次
String str="[Msgs][0][Phone]" Pattern p = Pattern.compile("\\[(.*?)\\]"); Matcher m = p.matcher(str); int count = 0; while (m.find()) { count++; System.out.println(m.group(1)); } System.out.println(count);