我用这个正则表达式来匹配email地址[email protected],但是调用match后总是返回false,请问是哪里不对啊?
CAtlRegExp<> reUrl;
REParseError status = reUrl.Parse(
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" );
if (REPARSE_ERROR_OK != status)
{
// Unexpected error.
return 0;
} CAtlREMatchContext<> mcUrl;
if (!reUrl.Match(
"[email protected]",
&mcUrl))
{
// Unexpected error. //总是返回false,请问是怎么回事?
return 0;
}
CAtlRegExp<> reUrl;
REParseError status = reUrl.Parse(
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" );
if (REPARSE_ERROR_OK != status)
{
// Unexpected error.
return 0;
} CAtlREMatchContext<> mcUrl;
if (!reUrl.Match(
"[email protected]",
&mcUrl))
{
// Unexpected error. //总是返回false,请问是怎么回事?
return 0;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货