Home  >  Article  >  Backend Development  >  电子信箱的格式对吗?该如何处理

电子信箱的格式对吗?该如何处理

WBOY
WBOYOriginal
2016-06-13 13:49:15909browse

电子信箱的格式对吗?
if(form1.txtemail.value.search("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)\\. \\w+([-.]\\w+)*$")!=0){
alert("电子信箱格式不正确!");
form1.txtemail.focus();
return false;
}

------解决方案--------------------
自己翻一下正则表达式的用法吧。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn