For example, in JS I validate with this regex first using
This is a regex I picked up off emailregex.com and seems to validate everything fairly well.
After the form is submitted I use php
filter_var($email, FILTER_VALIDATE_EMAIL) to once again validate.
Does this method have any downsides and would there be any better ways to do this?