1.工具类
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.nanci.dto.response.PhoneResponse;
/**
* @description : 电话号码验证
* @author : Nanci
* @time : 2020年9月18日上午8:58:56
*/
public class PhoneUtils {
/**
* @methodsname : 验证手机号是否合法
* @author : Nanci
* @time : 2020年9月18日上午9:36:25
* @param : mobile 手机号码
* @return : PhoneResponse
*/
public static PhoneResponse isMobileNO(String mobile) throws Exception {
PhoneResponse reponse = new PhoneResponse();
if (mobile.length() == 11) {
/**
* 移动号段正则表达式
*/
String pat1 = "^((13[4-9])|(147)|(15[0-2,7-9])|(172)|(178)|(18[2-4,7-8])|(198))\\d{8}|(1705)\\d{7}$";
/**
* 联通号段正则表达式
*/
String pat2 = "^((13[0-2])|(145)|(15[5-6])|(17[5,6])|(18[5,6]))\\d{8}|(1709)\\d{7}$";
/**