4 ms·
That's exactly what you should do. ^(.+)@(.+)$ max length is 254 according to the RFC I believe, so you can check for that too.
by fein 13y ago
That's exactly what you should do.
^(.+)@(.+)$
max length is 254 according to the RFC I believe, so you can check for that too.
- carbocation 13y agoBingo. I'm sure there are some HNers with arpanet emails who would appreciate this; it's not just about ipv6!
- therealunreal 13y agoIIRC, last I checked max length was 320.
- fein 13y agoI thought this as well, until looking for info one day and stumbling onto this: http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address http://stackoverflow.com/questions/386294/what-is-the-maximu... Turns out the 320 value was actually incorrect, its 256 but the mailbox is wrapped in square brackets, so 256 - 2 = 254.
- jnelso99 13y agoThe bonus with that regex is that it kind of looks like a dead clown.