^[\u4E00-\u9FA5A-Za-z0-9]+$
除去特殊符號(hào) 只允許中文、英文字母蜓耻、數(shù)字
//驗(yàn)證是否包含特殊字符
+(BOOL) SpecialCharactersValidateUserName:(NSString *)name
{
NSLog(@"name %@", name);
// "[^a-zA-Z0-9\u4E00-\u9FA5]"
NSString *userNameRegex = @"^[\u4E00-\u9FA5A-Za-z0-9]+$";
NSPredicate *userNamePredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",userNameRegex];
BOOL B = [userNamePredicate evaluateWithObject:name];
return B;
}