private Set<String> getCodes(String s) { Set<String> resultSet = new HashSet<>(); Matcher matcher = codePattern.matcher(s); while (matcher.find()) { resultSet.add(matcher.group(1)); } return resultSet; } private static Pattern codePattern = Pattern.compile("\"code\":\"(\\w+)\",");
原文:https://www.cnblogs.com/zhshlimi/p/9023045.html