Specifications
Equalizer Installation and Administration Guide 167
C Regular Expression Format
Equalizer supports only IEEE Std 1003.2 (POSIX.2) regular expressions in Match Rules. There are
many other variants and extensions of regular expressions, including those found in Perl, Java,
various shell languages, and the traditional Unix grep family of utilities; these variants are not
supported in Match Rules.
Regular expressions can be difficult to create and debug, and can use significvant system resources
to process. We recommend you use regular expressions only when no other Match Rule function
will provide the functionality you require.
To aid in creating correct and efficient regular expressions, you can use a regular expression
evaluator; many of these are available for download on the internet. Two free online regular
expression evaluators are also available at the following websites:
http://www.rexv.org/ (choose POSIX tab)
http://www.projects.aphexcreations.net/rejax/ (choose PHP POSIX Language)
Terms
The terms in this section describe the components of regular expressions.
•A regular expression (RE) is one or more non-empty branches, separated by pipe symbols (|).
An expression matches anything that matches one of the branches.
•A branch consists of one or more concatenated pieces. A branch matches a match for the first
piece, followed by a match for the second, and so on.
•A piece is an atom optionally followed by a single *, +, or ?, or by a bound.
n
An atom followed by an asterisk matches a sequence of 0 or more matches of the atom.
n
An atom followed by a plus sign matches a sequence of 1 or more matches of the atom.
n
An atom followed by a question mark matches a sequence of 0 or 1 matches of the atom.
•A bound consists of an open brace ({) followed by an unsigned decimal integer, between 0
and 255 inclusive. You can follow the first unsigned decimal integer with a comma, or a
comma and a second unsigned decimal integer. Close the bound with a close brace (}). If
there are two integers, the value of the first may not exceed the value of the second.
Learning About Atoms
An atom followed by a bound that contains one integer i and no comma matches a sequence of
exactly i matches of the atom. An atom followed by a bound that contains one integer i and a
comma matches a sequence of i or more matches of the atom. An atom followed by a bound
containing two integers i and j matches a sequence of i through j (inclusive) matches of the atom.
An atom can consist of any of the following: