C# 手机格式验证
//电信手机号码正则
Regex dReg = new Regex(@"^1[3578][01379]\d{8}$");
//联通手机号正则
Regex tReg = new Regex(@"^1[34578][01256]\d{8}$");
//移动手机号正则
Regex yReg = new Regex(@"^(134[012345678]\d{7}|1[34578][012356789]\d{8})$"); if (!(dReg.IsMatch(mobile) || tReg.IsMatch(mobile) || yReg.IsMatch(mobile)))
{
HttpContext.Current.Response.Write("{\"status\":\"failure\",\"msg\":\"手机号码格式不正确\"}");
return;
}