java正则匹配并提取字串

        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

原文地址:https://www.cnblogs.com/lzj123/p/8074841.html