标签:
public static class RegxCheck { /// <summary> /// 正则表达式验证是否为手机号 /// </summary> /// <param name="telNum">需要验证的手机号</param> /// <returns></returns> public static bool CheckTelNum(string telNum) { //电信手机号码正则 string telecom = @"^1[3578][01379]\d{8}$"; Regex telecomReg = new Regex(telecom); //联通手机号正则 string unicom = @"^1[34578][01256]\d{8}$"; Regex unicomReg = new Regex(unicom); //移动手机号正则 string cmcc = @"^(134[012345678]\d{7}|1[34578][012356789]\d{8})$"; Regex cmccReg = new Regex(cmcc); return telecomReg.IsMatch(telNum) || unicomReg.IsMatch(telNum) || cmccReg.IsMatch(telNum); } }
正则验证手机号(联通,电信,移动手机号),不包含座机号,作为会员登陆(正则验证) winform
标签:
原文地址:http://www.cnblogs.com/jolab/p/4418685.html