In Cocoa, regular expressions are presumably following the ICU Unicode rules for character matching and the ICU standard includes character properties such as \p{L}
for matching all kinds of Unicode letters. However
NSString* str = @"A";
NSPredicate* pred = [NSPredicate predicateWithFormat:@"SELF MATCHES '\\p{L}'"];
NSLog(@"%d", [pred evaluateWithObject:str]);
doesn't seem to compile:
Can't do regex matching, reason: Can't open pattern U_REGEX_BAD_INTERVAL (string A, pattern p{L}, case 0, canon 0)
If character properties are not supported (are they?), how else could I check if a string contains a Unicode letter in my iOS app?