I need to validate first and last name from Credit card. For example: "Lange Norton" or "LANGE NORTON" I use this code:
NSString *nameRegex = @"^[A-Z][a-z]*[\pL\pM\p{Nl}][A-Z][a-z]*$";
NSPredicate *nameTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", nameRegex];
return [nameTest evaluateWithObject:nameSurname];
And I have a problem with whitespace. "Unknown escape sequence '\p'" What should I do?