String str = "xxx第47297章33"; String regex = "\\d*"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(str);while (m.find()) {if (!"".equals(m.group())) System.out.println("come here:" + m.group());}
打印结果为
come here:47297come here:33
posted on 2013-03-26 09:25 阅读( ...) 评论( ...) 收藏