/// 验证手机号 |
public static bool IsMobile ( string source ) |
{ |
return Regex.IsMatch ( source, @"^1[35]\d{9}$" , RegexOptions.IgnoreCase ); |
} |
public static bool HasMobile ( string source ) |
{ |
return Regex.IsMatch ( source, @"1[35]\d{9}" , RegexOptions.IgnoreCase ); |
} |
初级程序员
by: 云代码会员 发表于:2013-05-02 15:47:01 顶(1) | 踩(0) 回复
现在应该是(source, @"^1[358]\d{9}$", RegexOptions.IgnoreCase )
回复评论