设置标签
NSString *regex = @"(^[A-Za-z0-9]$)"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; if ([predicate evaluateWithObject:string] == YES) { //implement return YES; }
设置标签
NSString *regex = @"(^[A-Za-z0-9]$)"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; if ([predicate evaluateWithObject:string] == YES) { //implement return YES; }