0 points

regex - How to validate an email address in JavaScript - Stack Overflow


dashboard

Wed Aug 19 2020 15:26:54 GMT+0000 (UTC)

Posted by @rdemo #javascript

function validateEmail(email) 
    {
        var re = /\S+@\S+\.\S+/;
        return re.test(email);
    }
    
console.log(validateEmail('anystring@anystring.anystring'));
content_copy Copy

https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript