[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNU Anubis supports two types of regular expressions: POSIX (both basic and extended), and Perl-style regular expressions. Among this, the former are always supported, whereas the support for the latter depends on the configuration settings at compile time. The default type of regular expressions is POSIX Extended.
A number of modifiers is provided to change the type of regular expressions. These are described in the following table.
:regex
:re
:perl
:perlre
:exact
:ex
:scase
:icase
:basic
:extended
The special statement regex
allows you to alter the default
regular expression type. For example, the following statement
regex :perl :scase |
sets the default regular expression types to Perl-style, case-sensitive.
The settings of regex
statement regard only those patterns that
appear after it in the configuration file and have force until the
next occurrence of the regex
statement.
A couple of examples:
if header[Subject] :perlre "(?<=(?<!foo)bar)baz" ... fi |
This will match any Subject
header whose value
matches an occurrence of `baz' that is preceded by `bar'
which in turn is not preceded by `foo'.
if header[Subject] :scase "^Re" |
will match a Subject
header whose value starts with `Re',
but will not match it if it starts with `RE' or `re'.
When using POSIX regular expressions, the extended syntax is enabled
by default. If you wish to use a basic regular expression, precede
it with the :basic
flag.
For the detailed description of POSIX regular expressions, See section `Regular Expression Library' in Regular Expression Library. For information about Perl-style regular expressions, refer to the Perl documentation.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |