日期:2014-05-20  浏览次数:20862 次

求一个正则!!急!!
br['35']='266,A 111,B 222'

我需要匹配出35,正则该怎么写啊

------解决方案--------------------
String str = "br['35']='266,A 111,B 222'";
Pattern pattern = Pattern.compile("br\\['(\\d*)'\\]");
Matcher matcher = pattern.matcher(str);
while (matcher.find()) {
System.out.println(matcher.group(1));
}