JS code that verifies that the mailbox format is correct




function chkEmail(strEmail) {
if (!/^w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*$/.test(strEmail)) {
return false;
}
else {
return true;
}
}