Validate email & password JS regEx

PHOTO EMBED

Fri Nov 05 2021 02:11:37 GMT+0000 (UTC)

Saved by @juancalle #javascript

const validateEmail = email => /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(email)

const validatePassword = password => /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/.test(password)
content_copyCOPY

http://zparacha.com/validate-email-address-using-javascript-regular-expression