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
2022-12-08 16:24:03
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