判断手机号

+ (BOOL)isValidateMobile:(NSString *)mobile
{
// 手机号以13,15,18,147开头,八个 \d 数字字符
NSString *phoneRegex = @"^((13[0-9])|(147)|(15[^4,\\D])|(18[0,0-9]))\\d{8}$";
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];

return [phoneTest evaluateWithObject:mobile];
}

posted on 2015-03-12 16:16  流以琳elim  阅读(125)  评论(0编辑  收藏  举报

导航