Re: CAtlRegExp kind of hangs with some expressions
Hi,
I'm using the following code (using the reg exp you posted) and it keeps
returning me "invalid email", the Match() is not returning true::
CAtlRegExp<> re;
TCHAR * atlgroup =
TEXT("\\s*(([\\w\\-]{1,}(\\.{0,}[\\w\\-]{1,}){0,}@[\\w\\-\\.]{0,}\\.[a-z]{2,5})[;,]\\s*)*([\\w\\-]{1,}(\\.{0,}[\\w\\-]{1,}){0,}@[\\w\\-\\.]{0,}\\.[a-z]{2,5})\\s*");
re.Parse (atlgroup);
CAtlREMatchContext<> mc;
if (re.Match (TEXT(abc@gmail.com), &mc))
{
cout<<"valid ";
}
else
{
cout<<"invalid ";
}
cout<<"email.";
What am I doing wrong?
...ab
"Brian Muth" <bmuth@mvps.org> wrote in message
news:e5KlTNMeHHA.4964@TK2MSFTNGP04.phx.gbl...
This monster is one of my favourites (warning, when this posts I'm
expecting to break over lines)
\s*(([\w\-]{1,}(\.{0,}[\w\-]{1,}){0,}@[\w\-\.]{0,}\.[a-z]{2,5})[;,]\s*)*([\w\-]{1,}(\.{0,}[\w\-]{1,}){0,}@[\w\-\.]{0,}\.[a-z]{2,5})\s*
It will accept multiple email addresses, separated by either commas or
semicolons.
Brian