Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a big point. The internet probably has a million systems that have a regexp somewhere listing all the top level domain names that were valid at the time, and half of them aren't maintained and will stay broken forever.

That being said, email validation needs to check for trivial issues (i.e., have you entered a non-empty string? does it have a @ somewhere?) and the proper validation happens if a verification email gets delivered or not.



To be honest, ^.+@.+$ is probably all you need, along with a confirmation email.


A simpler, yet equivalent regex : .@.

Also good: [^@]@[^@]


Addresses can contain multiple @s legally, though, right?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: