3 ms·
Using a regex to validate a URL is only marginally less stupid than using a regex to validate an e-mail address. Validating URLs is also something you shouldn'
by pluma 11y ago
Using a regex to validate a URL is only marginally less stupid than using a regex to validate an e-mail address.
Validating URLs is also something you shouldn't have to implement yourself.
- nalllar 11y agoValidating email addresses with a regex is fine if you follow the HTML5 spec for email addresses: http://www.w3.org/TR/html5/forms.html#valid-e-mail-address http://www.w3.org/TR/html5/forms.html#valid-e-mail-address > This requirement is 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.