Back to: Flexible redirections Contents and Introduction

Regular expressions used in the _redirect.cfg configuration file

The following are the valid
     symbols and associated meanings:

     .     A period (.) is a one-character RE  that  matches  any
           character except new-line.
     *     A one-character RE followed by an asterisk (*) is a RE
           that  matches  0  or  more  occurrences  of  the  one-
           character RE. If there  is  any  choice,  the  longest
           leftmost string that permits a match is chosen.
     ^     A circumflex (^) at the beginning of an entire RE con-
           strains that RE to match an initial segment of a line.
     $     A dollar sign ($) at the end  of  an  entire  RE  con-
           strains that RE to match a final segment of a line.
     []    A non-empty string of characters  enclosed  in  square
           brackets  ([])  is a one-character RE that matches any
           one character in that string. If, however,  the  first
           character  of the string is a circumflex (^), the one-
           character RE matches any character except new-line and
           the remaining characters in the string. The ^ has this
           special meaning only if it occurs first in the string.
           The  minus (-) may be used to indicate a range of con-
           secutive characters; for example, [0-9] is  equivalent
           to  [0123456789].  The - loses this special meaning if
           it occurs first (after an initial ^, if any)  or  last
           in  the  string. The right square bracket (]) does not
           terminate such a string when it is the first character
           within  it  (after an initial ^, if any); for example,
           []a-f] matches either a right square  bracket  (])  or
           one  of  the  ASCII letters a through f inclusive.
     +     A regular expression followed by + means one  or  more
           times.   For   example,   [0-9]+   is   equivalent  to
           [0-9][0-9]*.
     {m} {m,} {m,u}
           Integer values enclosed in {} indicate the  number  of
           times  the  preceding  regular  expression  is  to  be
           applied. The value m is the minimum number and u is  a
           number, less than 256, which is the maximum. If only m
           is present (that is,  {m}),  it  indicates  the  exact
           number  of  times  the  regular  expression  is  to be
           applied. The value {m,} is analogous to  {m,infinity}.
           The  plus  ( +) and star (*) operations are equivalent
           to {1,} and {0,} respectively.
     ( ... )$n
           n can have value from 0 to 4. The value of         the
           enclosed regular expression is stored and can be  used
           with variable $0, $1, $2, $3, $4.  At most,       five
           enclosed  regular expressions are allowed.
     ( ... )
           For compatibility with previous version ( ... )     is
           considered as ( ... )$1

	

Data Centre