(String str)
| 41 | } |
| 42 | //身份证匹配 |
| 43 | public static String IdCard(String str){ |
| 44 | ArrayList<String> id = new ArrayList<>(); |
| 45 | String is_id = "\\b[1-9]\\d{5}(?:19|20)\\d\\d(?:0[1-9]|1[012])(?:0[1-9]|[12]\\d|3[01])\\d{3}(?:\\d|X|x)"; |
| 46 | Matcher matcher = Pattern.compile(is_id).matcher(str); |
| 47 | while (matcher.find()){ |
| 48 | id.add(matcher.group()); |
| 49 | } |
| 50 | // 去重 |
| 51 | List<String> id_rd = Re.removeDuplicate(id); |
| 52 | return StringUtils.strip(id_rd.toString(),"[]"); |
| 53 | } |
| 54 | //特殊字段匹配 |
| 55 | public static String Password(String str){ |
| 56 | ArrayList<String> pwd = new ArrayList<>(); |
no test coverage detected