Email validation head-to-head


Quick links: Source code | Email address validators head-to-head

I’ve discovered a number of other public-domain functions that attempt to validate the format of an email address. I tried to validate my 124 test cases against these functions with the results below:

Dominic Sayers: 100% correctly validated
Simon Slick: 88% 
Dave Child: 80%
Cal Henderson: 72%

Interestingly, all the other functions failed correctly to validate the example addresses given in RFC3696 (Section 3: Restrictions on email addresses).

I couldn’t include Doug Lovell’s function in my tests because the code is copyright All Rights Reserved by Linux Journal (ironically).

Some of the other functions also supply test cases; I’ve added these to my test suite. More analysis and commentary here: RFC-compliant email address validator.

In summary, I recommend you use my function if you want totally RFC-compliant address validation.

Quick links: Source code | Email address validators head-to-head

Advertisements

3 Responses to “Email validation head-to-head”


  1. 1 Dominic Sayers February 13, 2009 at 16:49

    I’ve updated my page and the tests to v0.8 based on the responses from Dave Childs and Cal Handerson, and further input from Phil Haack.

  2. 2 Dominic Sayers February 10, 2009 at 18:20

    Another message, this time from Cal Henderson, making much the same point as Dave Child.

    Thanks for the input, chaps.

  3. 3 Dominic Sayers February 10, 2009 at 15:41

    I had a nice reply from Dave Child, pointing out that he was right and I was wrong about one of his test cases :-)

    I have corrected the page on my web site.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: