I am using a NSPredicate to determine if an entered email address is valid. On 10.6 it works perfectly as expected. I recently decided to get my app going on 10.5 and this is the only thing that doesn't work.
The error i get is as follows:
"Can't do regex matching, reason: Can't open pattern U_MALFORMED_SET (string
[email protected], pattern ([\w-+]+(?:\.[\w-+]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}), case
0, canon 0)"
The code im using is as follows:
NSString *regex = @"([\\w-+]+(?:\\.[\\w-+]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7})";
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
if ([regextest evaluateWithObject:[userEmail objectValue]] == YES)
Does anyone know why this isn't working on 10.5? And how I might get it working or be able to do this test in a way compatible for both 10.5 and 10.6?