Are you sure you want to be matching against self?

Dave

Sent from my iPhone

On Apr 15, 2011, at 6:30 AM, Michael Crawford <michaelacrawf...@me.com> wrote:

> 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}$", 
> NSValidationErrorValue=michaelacrawf...@me.com
> 
> 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 (Cocoa-dev@lists.apple.com)
> 
> 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/davedelong%40me.com
> 
> This email sent to davedel...@me.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to