How do I make a pattern for an email address that is only valid if it contains at least one character, followed by an @ sign, followed by at least one character, followed by a period (.) followed by at least “co”. (So, “a@b.co” is an example of the “least valid” email address)
Asked
Active
Viewed 91 times
0
-
check out the similar thread dude, it might be helpful http://stackoverflow.com/questions/5601647/html5-email-input-pattern-attribute – AMT Aug 06 '13 at 13:22
1 Answers
0
You will need to use regex to validate the email address. I suggest you look here if you don't know about regular expressions. The expression for validating an email is this:
/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/
You will have to validate it using JavaScript regex. Check that out here.

imulsion
- 8,820
- 20
- 54
- 84