Can anyone share their experience/recommendations for validation libraries? I'm looking for something that is simple to use, comes with predefined validations for things like email addresses, mobile numbers, etc. It should also be easily extensible and customisable with support for customer error messages and error codes. Thanks in advance.
Email addresses and phone numbers are always going to be an issue though. The email RFC is much more complicated than most people assume. The phone number spec is completely different from one country to another.
The only reliable strategy is to send an email/SMS to that number, and ask the user to prove they received it. Other than that, it's not worth trying to do any complicated tests other than maybe "an email should have an @" and a max-size check to avoid DoS attacks
10/12/2023, 10:25 PM
Agreed that “the best way to know if an email is valid is just to send it mail”