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

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

WBOY
Release: 2016-06-13 13:49:15
Original
926 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template