正则判断手机号


package example.com.mvp08.Untils;

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

/**
 * author:Created by niuyuejiao on 2018/4/20.
 */

public class CommonPhone {
    public static boolean isMobileNO(String mobiles){
        Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
        Matcher m = p.matcher(mobiles);
        System.out.println(m.matches()+"---");
        return m.matches();
    }
}

猜你喜欢

转载自blog.csdn.net/niu_yue_jiao/article/details/80016689