re: How to validate an email address in JavaScript VIEW POST

FULL DISCUSSION
 

You could also use <input type="email"> if you're targeting not-edge.

I always jump to the RFC-5322 standard regex (emailregex.com/), but the above seems smaller and less complicated for most projects that don't need to 100% cover all cases.

/^(([^<>()\[\]\\.,;:\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,}))$/
 

This regular expression does not validate the new top level domains such as https://はじめよう.みんな/index.html

 

You can use u at the end to do unicode validation too IIRC.

code of conduct - report abuse