NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
if(!([tfContact.text isMatch:RX(@"1\\d{10}")]&&([tfContact.text length]==11)) && ![tfContact.text isMatch:RX(emailRegex)]){//驗(yàn)證手機(jī)號(hào)碼和郵箱
[[[UIAlertView alloc] initWithTitle:@"提示" message:@"聯(lián)系方式不正確" delegate:self cancelButtonTitle:@"確認(rèn)" otherButtonTitles:nil] show];
return;
}
推薦閱讀:
http://blog.csdn.net/dyllove98/article/details/8635079