I'm not even going to try and explain this regular expression ... what matters is that it works!
function invalidEmail($str) {
if (preg_match("/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/", $str)) return false;
else return true;
}
function invalidEmail(str) {
if (str.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/))
return false;
else return true;
}
>> Posted in Websites at 15:11, and viewed 6,990 times
Next article: PHP Email Read Receipt (24 November 2009)
Next Websites article: Mailto: Syntax (16 March 2010)
Add your comments