#pragma mark -手机号码判断
-(BOOL)isValidatephone:(NSString *)phone{
NSString *Regex =@"(13[0-9]|14[57]|15[012356789]|18[02356789])\\d{8}";
NSPredicate *mobileTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", Regex];
return [mobileTest evaluateWithObject:phone];
-(BOOL)isValidatephone:(NSString *)phone{
NSString *Regex =@"(13[0-9]|14[57]|15[012356789]|18[02356789])\\d{8}";
NSPredicate *mobileTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", Regex];
return [mobileTest evaluateWithObject:phone];
}
#pragma mark - 邮箱验证
-(BOOL)isValidateEmail:(NSString *)email{
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
return [emailTest evaluateWithObject:email];
}