RFC 5322's address grammar is too complicated to allow for validation with a
regular expression, and you're going to end up rejecting perfectly legitimate
email addresses if you try. Plus, even if you somehow came up with the perfect
validation routine, it doesn't ensure that the address is actu
On Apr 15, 2011, at 6:30 AM, Michael Crawford 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}$
>
You cannot
I'm not a Core Data guru at all, but the regex you supplied will not match
lower case letters. (My understanding is that Core Data string comparisons are
case insensitive by default, but does this apply to regexes?)
In any case, be aware that there are many syntactically valid email addresses
t
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 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 fo
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, NSLocalizedDe