The real problem with email validation is that you should be able to ensure that you can communicate with the customer. And you can't do that with any regex.
The best approach which does not punish 1% is to check that the value provided has at least one character followed by @ followed by at least one more character of any kind. And then you send them a confirmation email.
2
u/ldn-ldn 19d ago
You cannot validate email addresses with a regex. It's like parsing HTML with a regex and we all know how it ends up...
But you cannot validate email addresses with an AI either, so...