判断邮箱格式是否正确:
-(BOOL)isValidateEmail:(NSString*) email
{
NSString* emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-
z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate*emailTest=[NSPredicate predicateWithFormat: @"SELFMATCHES%@", emailRegex];
return [emailTest evaluateWithObject: email];
}
希望对你有帮助!
网友评论