package com.ssj.framework.basic.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author yanghuan
 * @title: PhoneVerifyUtil
 * @projectName ssj
 * @description: 手机号校验
 * @date 2020/4/9 16:12
 */
public class PhoneVerifyUtil {

    public static boolean vertifyPhone(String phone){
        boolean flag=true;
        String regex="^((\\+86)|(86))?(1[2,3,4,5,6,7,8,9][0-9])\\d{8}$";
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(phone);
        boolean isMatch = m.matches();
        if(!isMatch){
            flag=false;

        }
        return flag;

    }
}