Java script can check the regular expression pattern for valid email address.
We have different regular expression patterns for validating email address.
We can validate email address at client side and server side.
To validate email address on client side, we can use java script with regular expression.
Pragmatically you can only assume it contains one @ and that there is at least one .
Client side validation is performed by a web browser, before input is sent to a web server.
Your regular expression is way too simple to pass for a solid implementation anyway.
See the real thing here: shouldn't the email addresses be validated client side?
Often, email validation code for web applications checks only for the position of @ and period characters, also assuming the @ character will be in the front of period. Did you know you can use a Java Script Regular Expressions method to check email addresses?
Here’s a fairly common code sample from Rails Applications with some sort of authentication system: If you’re experienced at Regex, this seems simple. Sections 3.2.4 and 3.4.1 of the RFC go into the requirements on how an email address needs to be formatted and, well, there’s not much you can’t do in your email address when quotes or backslashes are involved.