I'm currently trying to validate email address using regular expression in JavaScript. These are the requirements of the Email address:
- The email field contains a user name part follows by "@" and a domain name part.
- The user name contains word characters including hyphen ("-") and period (".").
- The domain name contains two to four parts of alphabet characters word extension.
- Each word extension is separated by a period (".") and the last extension must have two to three characters.
Among four requirements, the third one is most confusing to me. I will be very appreciate if someone can help me. Thank you.
I have tried the first answer in this page, but this answer accept even 5 or more extensions, so it doesn't meet my third requirement.