egrep
style pattern matching.
#include <OTC/text/regexp.hh> class OTC_Regexp : public OTC_Pattern {
public:
static os_typespec* get_os_typespec();
~OTC_Regexp();
OTC_Regexp(char const* thePattern);
OTC_Boolean match(char const* theString);
u_int start() const;
u_int start(u_int theIndex) const;
u_int length() const;
u_int length(u_int theIndex) const;
inline OTC_Range range() const;
OTC_Range range(u_int theIndex) const;
OTC_Boolean isValid() const;
inline char const* error() const;
static OTC_Regexp& whiteSpace();
static OTC_Regexp& optWhiteSpace();
static OTC_Regexp& nonWhiteSpace();
static OTC_Regexp& integerValue();
static OTC_Regexp& realValue();
static OTC_Regexp& alphabetic();
static OTC_Regexp& lowerCase();
static OTC_Regexp& upperCase();
static OTC_Regexp& alphaNumeric();
static OTC_Regexp& identifier();
static OTC_Regexp& matchingQuotes();
static OTC_Regexp& quotedString();
protected:
void compile();
};
egrep(1)
manual page for the format of
the pattern.
OTC_Regexp(char const* thePattern);
thePattern
.
OTC_Boolean match(char const* theString);
OTCLIB_TRUE
if the pattern matched
against theString
.
u_int start() const;
u_int start(u_int theIndex) const;
theIndex
.
u_int length() const;
u_int length(u_int theIndex) const;
theIndex
.
inline OTC_Range range() const;
OTC_Range range(u_int theIndex) const;
theIndex
.
OTC_Boolean isValid() const;
OTCLIB_TRUE
if the pattern was
valid.
inline char const* error() const;
static OTC_Regexp& whiteSpace();
static OTC_Regexp& optWhiteSpace();
static OTC_Regexp& nonWhiteSpace();
static OTC_Regexp& integerValue();
static OTC_Regexp& realValue();
static OTC_Regexp& alphabetic();
static OTC_Regexp& lowerCase();
static OTC_Regexp& upperCase();
static OTC_Regexp& alphaNumeric();
static OTC_Regexp& identifier();
static OTC_Regexp& matchingQuotes();
\\"
in
the string.
static OTC_Regexp& quotedString();
\\"
in string.
void compile();