我有类似 str = Adobe Flash Player 11.4.402.287 (11.3 MB) 的字符串,我只需要提取 Adobe Flash Player 作为输出。请建议..
我尝试使用正则表达式:
String str = "Adobe Flash Player 11.4.402.287 (11.3 MB)";
Pattern p = Pattern.compile("^[a-zA-Z]+([0-9]+).*");
Matcher m = p.matcher(str);
if (m.find()) {
System.out.println(m.group(1));
}