ENH: add wordRes::matching() method

- returns indices of matching entries.
This commit is contained in:
Mark Olesen
2018-11-09 21:21:15 +01:00
parent dff2569c7f
commit 91cfe4c271
13 changed files with 114 additions and 18 deletions

View File

@ -54,9 +54,9 @@ bool Foam::functionEntries::removeEntry::execute
Istream& is
)
{
const List<keyType> patterns = functionEntry::readStringList<keyType>(is);
const wordRes patterns(functionEntry::readStringList<wordRe>(is));
for (const keyType& key : patterns)
for (const wordRe& key : patterns)
{
if (key.isLiteral() && key.find('/') != string::npos)
{
@ -72,7 +72,7 @@ bool Foam::functionEntries::removeEntry::execute
{
// Remove by pattern
const wordList dictKeys = parentDict.toc();
const labelList indices = findStrings(regExp(key), dictKeys);
const labelList indices = findStrings(key, dictKeys);
for (const auto idx : indices)
{