expression

Last update: 2021-07-12
  • Created for:
  • Developer
    User

Regular expression pattern element. Optional in <rule> elements.

Attributes

None.

Data

Regular-expression pattern string.

Description

The <expression> element can be empty or contain a simple search string or a regular-expression pattern. The pattern is applied to the entire request string.

A match always occurs when <expression> is empty or not specified; this is equivalent to specifying <expression>.*</expression>.

The implementation is based on the Java package java.util.regex, which provides regular expression syntax similar to Perl’s.

Notes

The expression string must not contain literal < and & characters. These reserved characters can be encoded with & and <, respectively, or the entire string can be enclosed in an XML CDATA section:

<expression><![CDATA[&fmt=custom]]></expression>

All characters between the <expression> and </expression> tags are passed to the regular expression parser, including characters outside the optional CDATA section. Care should be taken to avoid extra whitespace.

See also

java.util.regex

On this page