Expressions are composed of characters and operators. Operators
are characters with special meaning to REX. The following
characters have special meaning: "\=+*?{},[]^$.-!" and must
be escaped with a `\' if they are meant to be taken literally.
The string ``>>'' is also special and if it is to be matched,
it should be written ``\>>'' .
A `\' followed by an `R' or an `I' mean to begin
respecting or ignoring alphabetic case distinction. (Ignoring case is
the default.) These switches DO NOT apply inside range brackets.
A `\' followed by an `L' indicates that the characters
following are to be taken literally up to the next `\L'. The
purpose of this operation is to remove the special meanings from
characters.
A subexpression following `\F' (followed by) or `\P'
(preceded by) can be used to root the rest of an expression to which
it is tied. It means to look for the rest of the expression ``as long as followed
by ...'' or ``as long as preceded by ...'' the subexpression
following the \F or \P, but the designated subexpression will be
considered excluded from the located expression itself.
A `\' followed by one of the following `C' language character
classes matches that character class: alpha, upper, lower,
digit, xdigit, alnum, space, punct,
print, graph, cntrl, ascii.
A `\' followed by one of the following special characters
will assume the following meaning: n=newline, t=tab,
v=vertical tab, b=backspace, r=carriage return,
f=form feed, 0=the null character.
A `\' followed by Xn or Xnn where n is a
hexadecimal digit will match that character.
A `\' followed by any single character (not one of the above)
matches that character.
The character `^' placed anywhere in an expression (except after a
`[') matches the beginning of a line. ( same as: \x0A in Unix or
\x0D\x0A in DOS )
The character `$' placed anywhere in an expression
matches the end of a line. ( \x0A in Unix, \x0D\x0A in DOS )
The character `.' matches any character.
A single character not having special meaning matches that character.
A string enclosed in brackets [] matches any single character
from the string. Ranges of ASCII character codes may be
abbreviated as in [a-z] or [0-9]. A `^'
occurring as the first character of the string will invert the
meaning of the range. A literal `-' must be preceded by a
`\'. The case of alphabetic characters is always respected
within brackets.
The `>>' operator in the first position of a fixed expression
will force REX to use that expression as the ``root'' expression
off which the other fixed expressions are matched. This operator
overrides one of the optimizers in REX. This operator can
be quite handy if you are trying to match an expression
with a `!' operator or if you are matching an item that
is surrounded by other items. For example: ``x+>>y+z+''
would force REX to find the ``y's'' first then go
backwards and forwards for the leading ``x's'' and trailing
``z's''.
The `!' character in the first position of an expression means
that it is NOT to match the following fixed expression.
For example: ``start=!finish+'' would match the word ``start''
and anything past it up to (but not including the word ``finish''.
Usually operations involving the NOT operator involve knowing
what direction the pattern is being matched in. In these cases
the `>>' operator comes in handy. If the `>>' operator is
used, it comes before the `!'. For example:
``>>start=!finish+finish'' would match anything that began
with ``start'' and ended with ``finish''. THE NOT
OPERATOR CANNOT BE USED BY ITSELF in an expression, or as the root
expression in a compound expression. NOTE: This NOT operator
``nots'' the whole expression rather than its sequence of characters,
as in earlier versions of REX.