I just answered a similar question: https://stackoverflow.com/a/12674524/340736
My recommendation to you would be, don't try to roll you're own. You'll probably do it wrong. Try to follow standards, such as RFC 822. It's not that easy to do by your self, but there are libraries that does this.
An example is Verimail.js. It follows RFC 822 but also does TLD validation according to the full list of TLDs registerd by IANA.
It's also simple to use:
var email = "[email protected]";
var verimail = new Comfirm.AlphaMail.Verimail();
verimail.verify(email, function(status, message, suggestion){
if(status < 0){
// Incorrect syntax!
}else{
// Syntax looks great!
}
});
The above example will hit the line 'Incorrect syntax!' because of the invalid TLD 'cmo'. Besides this, it will also give a suggestion that you can return to your user, in this case, the suggestion variable will contain '[email protected]' since 'fabeook.cmo' looks a lot like 'facebook.com'.
Hope this helps!