照着手机号的靓号,写了下匹配规则
1.ABCDABCD
String regex = "^1\\d{2}(\\d)(\\d)(\\d)(\\d)\\1\\2\\3\\4$";
2.ABCD
String regex = "^1\\d{6}(0123|1234|2345|3456|4567|5678|6789)$";
3.DCBA
String regex = "^1\\d{6}(9876|8765|7654|6543|5432|4321|3210)$";
4.AAAAA(含大于5个A)
String regex = "^1\\d{5}(\\d)\\1{4}$"; |
|