PHP 邮箱正则表达式代码如下:

/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])*(\.([a-z0-9])([-a-z0-9_-])([a-z0-9])+)*$/i

实例演示:


以上代码运行输出结果为:

string(17) "w3cmap@www.w3cmap.com"
[1]=>
string(1) "r"
[2]=>
string(5) "unoob"
[3]=>
string(1) "o"
[4]=>
string(1) "b"
[5]=>
string(1) "b"
[6]=>
string(4) ".com"
[7]=>
string(1) "c"
[8]=>
string(1) "o"
[9]=>
string(1) "m"
}