iOS 之郵箱判斷

//郵箱正則表達式正則表達式

-(BOOL)isValidateEmail:(NSString *)email;lua

 

- (BOOL)isValidateEmail:(NSString *)email {orm

    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";it

    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];email

    return [emailTest evaluateWithObject:email];date

}di

相關文章
相關標籤/搜索