Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWCRegexp
Synopsis
Description
Persistence
Example
Public Constructors
Public Destructor
Assignment Operators
Public Member Functions
Synopsis
#include <rw/regexp.h>
RWCRegexp re(".*\\.doc");// Matches filename with suffix ".doc"
Description
Class RWCRegexp represents a regular expression. The constructor "compiles" the expression
into a form that can be used more efficiently. The results can then be used for string searches
using class RWCString.
The regular expression (RE) is constucted as follows:
The following rules determine one-character REs that match a single character:
1.1 Any character that is not a special character (to be defined) matches itself.
1.2 A backslash (\) followed by any special character matches the literal character itself. I.e.,
this "escapes" the special character.
1.3 The "special characters" are:
+ * ? . [ ] ^ $
1.4 The period (.) matches any character except the newline. E.g., ".umpty" matches either
"Humpty" or "Dumpty."