Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWCRExpr
Synopsis
Description
Persistence
Example
Public Constructors
Public Destructor
Assignment Operators
Public Member Functions
Synopsis
#include <rw/re.h>
RWCRExpr re(".*\\.doc"); // Matches filename with suffix ".doc"
Description
Class RWCRExpr represents an extended regular expression such as those found in lex and awk.
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. Regular expressions can be of arbitrary
size, limited by memory. The extended regular expression features found here are a subset of those
found in the POSIX.2 standard (ANSI/IEEE Std 1003.2, ISO/IEC 9945-2).
Note: RWCRExpr is available only if your compiler supports exception handling and the C++
Standard Library.
The regular expression (RE) is constructed as follows:
The following rules determine one-character REs that match a single character:
Any character that is not a special character (to be defined) matches itself.
A backslash (\) followed by any special character matches the literal character itself; that is,
this "escapes" the special character.
1.
The "special characters" are:2.