Hello Everyone:I was wondering if anyone has developed a way to validate email addresses?
OriginalPostID-204914
Discussion posts and replies are publicly visible
The code I posted in the above linked thread is something I've worked on a lot in the past, to make sure it's robust and flexible (though a regex solution might still be admittedly more powerful). I'm attaching the latest version of my generalized rule here if anyone wants to refer to it. I guess the pro of this rule is that it's OOB and fairly easy to understand and tweak as needed.
Email Validation.sail
Thanks Mike!
Thanks Mike - this was extremely helpful!
thanks MIke
The fully RFC 822 compliant regex is inefficient and obscure for validate email address because of its length. Fortunately, RFC 822 was superseded twice and the current specification for email addresses is RFC 5322. RFC 5322 leads to a regex that can be understood if studied for a few minutes and is efficient enough for actual use.
If you use HTML5, use this code:
<input type="email" name="email" required placeholder="Enter a valid email address">