0

I want to check if the provided email id is valid or not in typescript.I am trying to use a pattern to validate the email but it's not working.Please help.Thanks in advance.

Ts code:

checkemail='/^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/';

validate(email:string)              
if (email.match(this.checkEmail)) {
    //do something
}
rock11
  • 718
  • 4
  • 17
  • 34

0 Answers0