This is written using several other developer's work with my tying it all together and adding a few small requirement of my own.
allows Latin characters (“a” - “z” or “A” - “Z”) within the email address. permits digits (0 - 9) in the email address. enforces domain part restrictions. allows hyphens (-) inside the domain as long as they don’t lead or trail the domain. allows IP address literals surrounded with square brackets ([]) for the domain names. restricts sub-domains to a maximum length of 63 characters. applies local part restrictions. permits the set of special characters allowed by RFC 5322 (“!”, “#”, “$”, “%”, “&”, “’”, “*”, “+”, “-”, “/”, “=”, “?”, “^”, “_”, “`”, “{”, “|”, “}”, “~”) to reside in the local part. lets local part comprise as double quotes housing one or more sequences of ASCII characters. doesn’t allow trailing, leading, or consecutive periods anywhere within the email address. doesn’t allow spaces anywhere in the address