0

I am using regx email validation pattern in my angular application. As per requirement I Do not want the following characters: < > ( ) [ ] ; : , \

I am using below pattern.

let emailPattern = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;

Can some one help me on this.

Teh
  • 2,767
  • 2
  • 15
  • 16
  • 2
    Possible duplicate of [How to validate an email address in JavaScript](https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript) – Jamiec Sep 09 '19 at 13:31

1 Answers1

1

You can try using this Regex:

/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

or refer to the following question and its answers: How to validate an email address in JavaScript

Miral Kumbhani
  • 153
  • 1
  • 3
  • 16