gistfile1.txt /** * 解析字符串里面的所有code * code A00112 * @param formula * @return */ public static List paresCodes(String formula){ String A = "A[0-9]{5}"; List list = new ArrayList(); Pattern pattern = Pattern.compile(A); Mat
/** * 解析字符串里面的所有code * code A00112 * @param formula * @return */ public static ListparesCodes(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; }