EDElasticDomain

regex snippet

Email validation regex

Pragmatic email pattern for most forms.

^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$

Use with case-insensitive flag to keep the pattern readable:

const emailPattern = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i;
console.log(emailPattern.test("[email protected]"));