[JS] E-Mail Regex

PHOTO EMBED

Thu Oct 14 2021 19:02:39 GMT+0000 (Coordinated Universal Time)

Saved by @clumsycoder #javascript #regex #email

const validateEmail = email => {
    const 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,}))$/;
    return regex.test(String(email).toLowerCase());
  }
content_copyCOPY