mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
new wordRe class - a word that holds a regExp
- a possible future replacement for keyType, but the immediate use is the
wordReList for grepping through other lists.
- note that the argList treatment of '(' ... ')' yields quoted strings,
which we can use for building a wordReList
minor cleanup of regExp class
- constructor from std::string, match std::string and
operator=(std::string&)
rely on automatic conversion to Foam::string
- ditch partialMatch with sub-groups, it doesn't make much sense
This commit is contained in:
@ -40,6 +40,25 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< test << endl;
|
||||
|
||||
// test sub-strings via iterators
|
||||
string::const_iterator iter = test.end();
|
||||
string::const_iterator iter2 = test.end();
|
||||
string::size_type fnd = test.find('\\');
|
||||
|
||||
if (fnd != string::npos)
|
||||
{
|
||||
iter = test.begin() + fnd;
|
||||
iter2 = iter + 6;
|
||||
}
|
||||
|
||||
Info<< "sub-string via iterators : >";
|
||||
while (iter != iter2)
|
||||
{
|
||||
Info<< *iter;
|
||||
iter++;
|
||||
}
|
||||
Info<< "<\n";
|
||||
|
||||
Info<< string(test).replace("kj", "zzz") << endl;
|
||||
Info<< string(test).replace("kj", "") << endl;
|
||||
Info<< string(test).replaceAll("kj", "zzz") << endl;
|
||||
|
||||
Reference in New Issue
Block a user