fac22 / kindcode

We make code kinder with only the kindest kind of kind AI 👀
https://fac22.github.io/kindcode/
2 stars 0 forks source link

validate email - duplication of existing HMTL5 form validation #86

Open Moggach opened 3 years ago

Moggach commented 3 years ago

function validateEmail(email) { const input = /^(([^>()\[\]\\.,;:\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 input.test(email); }

Moggach commented 3 years ago

Just noticed that this could be replaced by https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email

Awesome site!