if (isChinese){
strRegex = @"^([\\u4e00-\\u9fa5])+|(^([\\u4e00-\\u9fa5])+[0-9]+)+"; //只能中文加数字,且数字必须在后面
}else{
strRegex = @"[A-Za-z\\s]+|([A-Za-z\\s]+[0-9]+)+";
}
邮箱校验:
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}+[A-Za-z.]{0,4}";