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:47297 come here:33