mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
full match
This commit is contained in:
@ -37,6 +37,8 @@ SourceFiles
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
|
#include "string.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -73,7 +75,7 @@ public:
|
|||||||
{
|
{
|
||||||
preg_ = new regex_t;
|
preg_ = new regex_t;
|
||||||
|
|
||||||
if (regcomp(preg_, s.c_str(), REG_EXTENDED|REG_NOSUB) != 0)
|
if (regcomp(preg_, s.c_str(), REG_EXTENDED) != 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
@ -102,10 +104,12 @@ public:
|
|||||||
//- Matches?
|
//- Matches?
|
||||||
inline bool matches(const string& s) const
|
inline bool matches(const string& s) const
|
||||||
{
|
{
|
||||||
size_t nmatch = 0;
|
size_t nmatch = 1;
|
||||||
regmatch_t *pmatch = NULL;
|
regmatch_t pmatch[1];
|
||||||
|
|
||||||
return regexec(preg_, s.c_str(), nmatch, pmatch, 0) == 0;
|
int errVal = regexec(preg_, s.c_str(), nmatch, pmatch, 0);
|
||||||
|
|
||||||
|
return (errVal == 0 && pmatch[0].rm_eo == label(s.size()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "primitiveEntry.H"
|
#include "primitiveEntry.H"
|
||||||
#include "dictionaryEntry.H"
|
#include "dictionaryEntry.H"
|
||||||
|
#include "regularExpression.H"
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
|
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,6 @@ SourceFiles
|
|||||||
#include "HashTable.H"
|
#include "HashTable.H"
|
||||||
#include "wordList.H"
|
#include "wordList.H"
|
||||||
#include "className.H"
|
#include "className.H"
|
||||||
#include "regularExpression.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward declaration of friend functions and operators
|
||||||
|
class regularExpression;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
Istream& operator>>(Istream&, dictionary&);
|
Istream& operator>>(Istream&, dictionary&);
|
||||||
Ostream& operator<<(Ostream&, const dictionary&);
|
Ostream& operator<<(Ostream&, const dictionary&);
|
||||||
|
|||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "inputModeEntry.H"
|
#include "inputModeEntry.H"
|
||||||
|
#include "regularExpression.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user