read

If you’re not technical, there’s nothing to see here. Move along please.

OK, I’m writing an email address validation function. Why? Because everybody else has and why should I be different? The catch is, I’m trying to make it RFC-compliant rather than use the same noddy regular expressions everybody else does.

Ask me anything you like about RFCs 1035, 2396, 3696, 4291, 4343, 5321 & 5322. Go on.

Try this one: RFC 1035 says the following:

The labels must follow the rules for ARPANET host names.  They must
start with a letter, end with a letter or digit, and have as interior
characters only letters, digits, and hyphen.

(A label is a component of a domain name, i.e. the “example” in example.com)

So is 3com.com a valid domain name? No? Somebody should tell them.