String^ matchStr = "eu";
String^ tempHeader;
for (int i = 0; i < header.size(); i++)
{
tempHeader = gcnew String(header[i].c_str());
if (Regex::Match(tempHeader, matchStr, RegexOptions::IgnoreCase))
{
index = i;
}
}
The above is the code I am trying to use for a Regular Expression, but regardless, it enters into the “IF” loop, and sets index = i.
This is because the call returns a
Matchobject, and it is notNULL. You need to check theSuccessproperty: