Tools.h++ Manual

104011 Tandem Computers Incorporated 21-71
21
Public member functions
size_t index(const RWCString& str, size_t* len, size_t
start=0) const;
Returns the index of the first instance in the string
str
that matches the
regular expression compiled in self, or
RW_NPOS
if there is no such match. The
search starts at index
start
. The length of the matching pattern is returned in
the variable pointed to by
len
. If an invalid regular expression is used for the
search, an exception of type
RWInternalErr
will be thrown.
Note – This member function is relatively clumsy to use—class
RWCString
offers a better interface to regular expression searches.
statVal status();
Returns the status of the regular expression:
statVal
Meaning
RWCRegexp::OK
No errors
RWCRegexp::ILLEGAL
Pattern was illegal
RWCRegexp::TOOLONG
Pattern exceeded maximum length