I'm trying to validate email addresses in Core Data but the regular expression
I'm using doesn't seem to work even though it looks correct. I'm using the
following expression:
^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$
Which produces the following error:
NSValidationErrorKey=email, NSLocalizedDescription=The operation couldn’t be
completed. (Cocoa error 1680.), NSValidationErrorPredicate=SELF MATCHES
"^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$",
[email protected]
I'm pretty certain the expression is correct so I'm thinking there must be
something I don't know about how to use it with Core Data. I'm inputing the
expression in the MOM editor in Xcode 4, not coding to the APIs directly. In
my code I'm calling -[NSManagedObject validateForInsert].
If you've run into problems using regular expressions with Core Data and then
found a solution or if you see some obvious problem with what I have here, I'd
love to here from you.
-Michael
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]