NSString *regex = @"^[a-zA-Z0-9\u4e00-\u9fa5]+$";
NSPredicate *pre = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL isMatch = [pre evaluateWithObject:str];
if (isMatch)
{
NSlog(@"符合规范");
}
NSString *regex = @"^[a-zA-Z0-9\u4e00-\u9fa5]+$";
NSPredicate *pre = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL isMatch = [pre evaluateWithObject:str];
if (isMatch)
{
NSlog(@"符合规范");
}