String content =”基础数据成功率:30%”;
Pattern p = Pattern.compile(“基础数据成功率:(.*?)%”);
Matcher m = p.matcher(content);
while(m.find()){
System.out.println(m.group(1));
}
- 输出30
String content =”基础数据成功率:30%”;
Pattern p = Pattern.compile(“基础数据成功率:(.*?)%”);
Matcher m = p.matcher(content);
while(m.find()){
System.out.println(m.group(1));
}