Seeing the amount of code let's me think of left-pad. Minimal code that should just be part of your own project instead of using a third party dependency.
Also obligatory: don't validate emails, just send the user an email and make them confirm by clicking a link in the mail.
There is this regex: https://emailregex.com/
Seeing the amount of code let's me think of left-pad. Minimal code that should just be part of your own project instead of using a third party dependency.
Also obligatory: don't validate emails, just send the user an email and make them confirm by clicking a link in the mail.