regExp - separate full match from partial match, add find()

- match() only does a full match
  - find() and search() do partial matches
    search() is similar to the name coming into C++ TR1
This commit is contained in:
Mark Olesen
2009-01-05 09:37:52 +01:00
parent 2717aa5c7d
commit 461ac4b4cc
6 changed files with 42 additions and 20 deletions

View File

@ -62,18 +62,18 @@ int main(int argc, char *argv[])
Info<< "true";
if (re.ngroups())
{
Info<< groups;
Info<< " groups:" << groups;
}
}
else
{
Info<< "false";
if (re.match(str, true))
if (re.search(str))
{
Info<< " partial match";
}
}
Info << endl;
Info<< endl;
}
Info<<"test regExp(const char*) ..." << endl;