<reponame>makeuseofcode/User-Account-Validation-RegEx<filename>JavaScript/email.js<gh_stars>0function checkEmailId(email) {
    if(/^[\w.-]+@([\w-]+\.)+[\w-]{2,4}$/.test(email)) {
        console.log('Valid');
    } else {
        console.log('Not Valid');
    }
}
checkEmailId('anpch@example.com');
checkEmailId('abc@nnheo@example.com'); 