166,198, 199等号段的加入,号段获取 移动,联通,电信号段
- (BOOL)isIphone:(NSString *)string
{
NSString *phoneRegex = @"^((13[0-9])|(15[0-9])|(17[0-9])|(18[0-9])|(14[4,5,6,7,8,9])|(19[8,9])|(166))\\d{8}$";
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
return [phoneTest evaluateWithObject:string];
}
网友评论