Joined 8 years ago
function isValidEmail(e) { const b = /^(([^<>()[\]\\.,;:\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 b.test((e + "").toLowerCase()) }
2. You're calling toLowerCase() yet the regex is already case-agnostic.
If you're going to attempt email address validation, either go all out[1], or just use isValidEmail=(e)=>~e.indexOf("@")
[1]: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
2. You're calling toLowerCase() yet the regex is already case-agnostic.
If you're going to attempt email address validation, either go all out[1], or just use isValidEmail=(e)=>~e.indexOf("@")
[1]: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html