Submitted over 2 years agoA solution to the Intro component with sign-up form challenge
Responsive landing page using CSS, HTML, JavaScript
@sandramsc

Solution retrospective
I'm not particularly sure why this regex works:
function validateEmail(email) { var re = /^[a-z][a-zA-Z0-9_.](.[a-zA-Z][a-zA-Z0-9_.])?@[a-z][a-zA-Z-0-9]*.[a-z]+(.[a-z]+)?$/; return re.test(String(email).toLowerCase()); }
And why this one doesn't: function validateEmail (email) { var re = /^(([^<>()[]\.,;:\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 re.test(String(email).toLowerCase()); }
Code
Loading...
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Sandra Ashipala's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord