-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Validating an email address string against RFC 5322 -- -- Validating an email address string against RFC 5322 @package email-validate @version 0.1 -- | Properly validating e-mail addresses (or converting EBNF to Parsec) -- -- In recent times there have been several calls for websites to properly -- validate email addresses. Invariably, the compiled regex from Perls -- RFC822 is pasted up as The Way To Do It. The problem with this is (as -- the source code from the Perl module notes) is that email addresses -- cannot be validated by a simple regex (due to requiring -- parenthesis-matching). The Perl code addresses this by first stripping -- out all comments and then parsing via regex. -- -- With this in mind, I thought that implementing the Addr-Spec -- specification from RFC 5322 (only released less than 6 months ago) -- might be a good test of the Haskell library Parsec. So, without -- further ado I went ahead and translated the EBNF from RFC 5322 -- directly into Parsec. -- -- Author: Porges Source: -- http://porg.es/blog/properly-validating-e-mail-addresses module Text.Email.Validate -- | Validate an email address encoded in a String satisifes RFC 5322 isValid :: String -> Bool