Pattern p = Pattern.compile("\(.*\)"); Matcher m = p.matcher("1.2.0(23)"); if(m.find()){ System.out.println(StringUtils.substring("1.2.0(23)", m.start(), m.end())); }
输出结果:23