49 #ifndef _DYNASHELL_REGEX_H 50 #define _DYNASHELL_REGEX_H 52 #include <sys/types.h> 59 #include <rnr/rnrconfig.h> 79 memset(&m_regex, 0,
sizeof(m_regex));
87 m_strRegEx = strRegEx;
134 return Match(strPat.c_str());
147 if( m_bIsValid && (regexec(&m_regex, sPat, 0, NULL, 0) == 0) )
165 return m_strRegEx.length() > 0? m_strRegEx.c_str(): NULL;
239 #endif // _DYNASHELL_REGEX_H regex_t m_regex
compiled reqular expression
bool Match(const char *sPat)
Match pattern against regular expression.
string m_strRegEx
pre-compiled regular expression string
const char * GetRegEx() const
Get this object's regular expression.
RegEx(const string &strRegEx)
String initialization constructor.
bool m_bIsValid
expression is [not] valid
RegEx & operator=(const char *rhs)
Assignment operator.
RegEx(const char *sRegEx)
Null-terminated string initialization constructor.
bool Match(const string &strPat)
Match pattern against regular expression.
RegEx & operator=(const RegEx &rhs)
Assignment copy operator.
virtual ~RegEx()
Default destructor.
bool IsValid()
Test if in valid state.
RegEx()
Default constructor.
RegEx(const RegEx &src)
Copy constructor.
RegEx & operator=(const string &rhs)
Assignment operator.