0


C# 判断是否是国内手机号(电信、联通、移动)

       private bool IsPhone(string phone)
        {
            //电信手机号码正则        
            string dianxin = @"^1[3578][01379]\d{8}$";
            Regex dReg = new Regex(dianxin);
            //联通手机号正则        
            string liantong = @"^1[34578][01256]\d{8}$";
            Regex tReg = new Regex(liantong);
            //移动手机号正则        
            string yidong = @"^(134[012345678]\d{7}|1[34578][012356789]\d{8})$";
            Regex yReg = new Regex(yidong);

            if(dReg.IsMatch(phone) || tReg.IsMatch(phone)|| yReg.IsMatch(phone))
            {
                return true;
            }
            return false;
        }
标签: c# wpf 后端

本文转载自: https://blog.csdn.net/qq_43393792/article/details/121864175
版权归原作者 李沉着 所有, 如有侵权,请联系我们删除。

“C# 判断是否是国内手机号(电信、联通、移动)”的评论:

还没有评论