1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "labelList.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 template<class StringType>
34 Foam::labelList Foam::findStrings
37 const UList<StringType>& lst
41 labelList matched(lst.size());
46 if (re.match(lst[elemI]))
48 matched[matchI++] = elemI;
51 matched.setSize(matchI);
57 template<class StringType>
58 Foam::labelList Foam::findStrings
60 const std::string& pattern,
61 const UList<StringType>& lst
65 labelList matched(lst.size());
70 if (re.match(lst[elemI]))
72 matched[matchI++] = elemI;
75 matched.setSize(matchI);
81 template<class StringType>
82 Foam::labelList Foam::findStrings
85 const UList<StringType>& lst
88 labelList matched(lst.size());
93 if (wre.match(lst[elemI]))
95 matched[matchI++] = elemI;
98 matched.setSize(matchI);
104 template<class StringType>
105 Foam::labelList Foam::findStrings
107 const UList<wordRe>& wreLst,
108 const UList<StringType>& lst
111 labelList matched(lst.size());
118 if (wreLst[reI].match(lst[elemI]))
120 matched[matchI++] = elemI;
125 matched.setSize(matchI);
131 template<class StringType>
132 bool Foam::findStrings
134 const UList<wordRe>& wreLst,
135 const StringType& str
140 if (wreLst[reI].match(str))
150 // ************************************************************************* //