//被正则的数据
String s = "aabbccdd123ccdd334";
//要使用的正则
String regexp = "[\\d]+";
Matcher p = Pattern.compile(regexp).matcher(s);
while (p.find()) {
System.out.println(p.group());
}
java正则
最新推荐文章于 2024-07-18 16:29:57 发布
//被正则的数据
String s = "aabbccdd123ccdd334";
//要使用的正则
String regexp = "[\\d]+";
Matcher p = Pattern.compile(regexp).matcher(s);
while (p.find()) {
System.out.println(p.group());
}