What this means "(\w|-)+@\w"? [message #174784] |
Thu, 07 July 2011 13:58 |
zhang yun
Messages: 3 Registered: July 2011
Karma:
|
Junior Member |
|
|
Hi,there
I have some problems in regular expression, here is code :
function is_email($e_name)
{
$arr = array("ac","com","net","org","edu","gov","mil","ac\.cn",
"com\.cn","edu\.cn","net\.cn","org\.cn");
$str = implode("|",$arr);
$reg ='/^[0-9a-zA-z](\w|-)+@\w+\.('.$str.')$/';
//echo $reg;
if(preg_match($reg,strtolower($e_name)))
return strtolower($e_name);
else
return false;
}
I don't know the exactly meaning of "(\w|-)+@\w", could you help me
figure out its meaning? I'm new to posix standard.
|
|
|