email trim
unknown
plain_text
3 years ago
292 B
2
Indexable
const validate = (email) => { if (email.trim(/^([a-zA-Z0-9_\-.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/).match() == null) { return false; } else if (email.trim() === '') { return false; } return true; }
Editor is loading...