4 ms·
[0] Yep. Although, to be fair, that is simply a generated expression based on what I assume are much simpler starting rules. That said, and this is a topic that
by rallison 13y ago
[0] Yep. Although, to be fair, that is simply a generated expression based on what I assume are much simpler starting rules. That said, and this is a topic that never ceases to come up, be simple and be lenient.
For every person who thinks their use case is special, it probably isn't. It is almost always better to do trivial validation that allows false positives than to try to be exact and forget a corner case (and, most likely, you'll end up forgetting multiple corner cases).
Want to help users with typos in email addresses without rejecting them? Use something like mailcheck:
https://github.com/Kicksend/mailcheck https://github.com/Kicksend/mailcheck
And, tons more discussion here: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address http://stackoverflow.com/questions/201323/using-a-regular-ex...
[1] Yep. That said, it is apparently useful for certain parts of HTML parsing/validation, as AntiSamy I believe uses regular expressions frequently. https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Proj...