1 -(BOOL)isValidateEmail:(NSString *)email { 2 NSString *emailRegex = @"[A-Z0-9a-z._%+-][email protected][A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 3 NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 4 return [emailTest evaluateWithObject:email]; 5 }
时间: 2024-10-11 17:25:27