0

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, “[email protected]” is an example of the “least valid” email address)

1

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.