NAME

OTC_Regexp - Class to perform egrep style pattern matching.

SYNOPSIS


#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();
};

CLASS TYPE

Concrete

DESCRIPTION

Refer to the egrep(1) manual page for the format of the pattern.

CONSTRUCTION

OTC_Regexp(char const* thePattern);

MATCHING

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;

ERRORS

OTC_Boolean isValid() const;
inline char const* error() const;

PATTERNS

Some commonly used regular expression are defined as constant character strings. These are:
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();

COMPILATION

void compile();

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED