java解析规律字符

为什么80%的码农都做不了架构师?>>>   hot3.png

/**
     * 解析字符串里面的所有code
     * code A00112
     * [@param](https://my.oschina.net/u/2303379) formula
     * [@return](https://my.oschina.net/u/556800)
     */
    public static List paresCodes(String formula){
        String A = "A[0-9]{5}";
        List list = new ArrayList<>();
        Pattern pattern = Pattern.compile(A);
        Matcher matcher = pattern.matcher(formula);
        while (matcher.find()){
            list.add(matcher.group());
        }
        return list;
    }

 

转载于:https://my.oschina.net/905430/blog/3045490

你可能感兴趣的:(java解析规律字符)