Skip to main content
Version: 5.7.x.x Java 8 ELS

Regular expressions

A regular expression has the following syntax:

[<type>/]<expression>[/]

where:

<expression>: The regular expression itself.
<type>:
PCRE[(<options>...)]:
Perl-style regular expression (regex). Without any option, a "dot" will not match any newline. Set the option "da" to achieve this.
<options>: A comma separated list of:
da: DOT_ALL. All characters (including newlines) are accepted as '.' (for example in '.*')
utf8: Perl-style regex using utf8 encoding.
cs: Case-sensitive. The regex is case-sensitive.
ci: Case-insensitive. The regex is case-insensitive. If both ("cs" and "ci") are set, then "ci" is taken.
CIDR:
CIDR notation of IP addresses and address ranges.
GLOB:
Unix style path pattern matching.
Rules list:
? matches exactly one character.
* matches zero or more characters, but not "/". When used alone between slashes ("/*/"), the wildcard requires at least one character.
** matches zero or more characters. This allows recursive directory matching.
/ matches one or more "/".
[<CHARACTERS>] lists allowed characters at the specified position. For example [ABC]* allows paths starting with A, B or C.
[<CHAR>-<CHAR>] matches a range of characters at the specified position. The previous example can be rewritten as [A-C]*.
[!<CHARACTERS>] lists disallowed characters.
The paths' ending can have any number of "/" characters.
The backslash is used to escape wildcards (?, *, [, \). For example to match paths that contain "?", use the following rule: "**\?**".

If no type is specified, PCRE is taken. If a different type is set, it will be specified in the relevant parameter of the respective filter or servlet.