I want to check the string if it contains alphanumeric only.(Both letters and number only).
I tried using NSCharacterSet *strCharSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"];
I also tried this NSString *string = @"[^a-zA-Z0-9]";
= no luck
but it only checks if the string does not contain any characters or it contains only this characters. I need to required the user to put both letters and numbers.
-update I have a textfield for password. I need the user to input both letters and password. But I can't check if the textfield contains BOTH letters and numbers. By using the code above, it only checks if the textfield's text contains only alphanumeric.