|
|
@ -10,7 +10,7 @@ import java.util.regex.Pattern; |
|
|
|
* @Date 2020/4/18 15:04 |
|
|
|
*/ |
|
|
|
public class PhoneValidatorUtils { |
|
|
|
private static final String REGEX_MOBILE ="((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))"; |
|
|
|
private static final String REGEX_MOBILE ="((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19([0-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))"; |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断是否是手机号 |
|
|
@ -23,5 +23,9 @@ public class PhoneValidatorUtils { |
|
|
|
} |
|
|
|
return Pattern.matches(REGEX_MOBILE, tel); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
System.out.println(isMobile("19353198889")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|