The ultimate email validation is just trying to send an email to the address and confirming with a code/link.
Off by one errors are about half of working with arrays.
a@domain fail
ab@domain fail
abc@domain ok> This requirement is a willful violation of RFC 5322, which defines a syntax for email addresses that is simultaneously too strict (before the "@" character), too vague (after the "@" character), and too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use here.
Personally, I say if it's good enough for Web browsers, it's probably good enough for your app.
document.querySelector("[type='email']").validity.valid
This will not only give you email validation for free, but also gives users with software keyboards (e.g. on phones) a contextual keyboard./^+@+$/ is easy and the false positives it allows are weird enough to accept.