用javascript的正则表达式来验证Email地址是否格式正确

[code]
function CheckExists()
{
var e = document.getElementById("mailaddress").value;
if(e != "") {
if(!/(\S)+[@]{1}(\S)+[.]{1}(\w)+/.test(e))
{
alert("请输入格式正确的 e-mail 地址!");
var email = document.getElementById ( "mailaddress" );
email.value = "";
email.focus ();
}
else
{
QuickRegisterBox.IsEMailExists(e, CheckExists_Callback);
}
}
}
[/code]

你可能感兴趣的:(java)