4 ms·
Somewhat unrelated, but out of curiosity, does anyone know of a site that lists — for all popular languages — various libraries/code snippets/routines which one
by asdfs 13y ago
Somewhat unrelated, but out of curiosity, does anyone know of a site that lists — for all popular languages — various libraries/code snippets/routines which one can use to correctly (according to the RFCs) check the validity of e-mail addresses?
If not I may be compelled to create one.
- taproot 13y agoThere isn't. Look up the regex for validating an email address it you'd like to know why.
- computer 13y agoJust send an email and see if it arrives.
- jabr 13y ago/.@./ is pretty much the best you can do. And even the dots are a bit iffy.
- rmc 13y agoThe RFC-compliant email address is actually incredibly complex. There are loads of things that are RFC-valid email addresses that basically hardly anyone uses (like spaces).
- callahad 13y agoThe HTML5 standard actually defines a mostly-sane regex, which achieves that sanity through "a willful violation of RFC 5322, which defines a syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too vague (after the "@" character), and too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use here." I like it. Link: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address http://www.whatwg.org/specs/web-apps/current-work/multipage/...
- mason240 13y ago@"^[^@]{1,}[@]{1}[^@]{1,}\.{1}[^@]{1,}$" I check it with this RegEx to make sure it's in the right format of [string]@[string].[string] to make sure that user at least tries to enter an email address, but beyond that sending and email and getting a response is the only way.
- drdaeman 13y ago> @"^[^@]{1,}[@]{1}[^@]{1,}\.{1}[^@]{1,}$" Is not > [string]@[string].[string] It's mere ^.+@.+\..+ (in both POSIX extended and PCRE dialects) that properly represents the latter. And even such regexp filters out many technically-valid but obscure cases of RFC-compliant email addresses (for example ai, io, kh and ws TLDs have MX records, and supposedly hostmaster@io should be a valid email address).
- neurostimulant 13y agoCheck out this incredibly complex rfc822 regex in action: http://regex101.com/r/fZ6cD5 http://regex101.com/r/fZ6cD5