3 ms·
Aha. Well, now we're approaching something more complex than /@/, aren't we? :) I will fully agree with the claim that a regex is the wrong way to validity-che
by geofft 10y ago
Aha. Well, now we're approaching something more complex than /@/, aren't we? :)
I will fully agree with the claim that a regex is the wrong way to validity-check an email, and I will easily believe that implementing the check you describe takes 5 kilobytes of regex. But a rule like "Exactly one un-quoted @ sign" or "Exactly one un-quoted @ sign, and the string on the right needs to be a well-formed domain name" or something is pretty simple in normal code.
"Well-formed domain name" is an existing concept: one or more labels separated by dots, each of which contains only ASCII letters, digits, or hyphens, cannot start or end with a hyphen, and cannot be more than 63 characters long, and no more than 253 characters total. Again, not something I'd do with a regex, but a small number of lines of code.
- Nadya 10y agoI'm not the original person you were speaking with - sorry for any confusion. Although you have me curious how you would check with code without using regex.