Specifying URL regular expressions (url_regex)

Entries of type url_regex within the configuration files use regular expressions to perform a match.

The following table offers examples to illustrate how to create a valid url_regex.

Value Description
x Matches the character x.
. Match any character.
^ Specifies beginning of line.
$ Specifies end of line.
[xyz] A character class. In this case, the pattern matches either x, y, or z.
[abj-oZ] A character class with a range. This pattern matches a, b, any letter from j through o, or Z.
[^A-Z] A negated character class. For example, this pattern matches any character except those in the class.
r* Zero or more r’s, where r is any regular expression.
r+ One or more r’s, where r is any regular expression.
r? Zero or one r, where r is any regular expression.
r{2,5} From two to five r’s, where r is any regular expression.
r{2,} Two or more r’s, where r is any regular expression.
r{4} Exactly 4 r’s, where r is any regular expression.
"[xyz]\"images" The literal string [xyz]"images"
\X If X is a, b, f, n, r, t, or v, then the ANSI-C interpretation of \x; Otherwise, a literal X. This is used to escape operators such as *.
\0 A NULL character.
\123 The character with octal value 123.
\x2a The character with hexadecimal value 2a.
(r) Matches an r; where r is any regular expression. You can use parentheses to override precedence.
rs The regular expression r, followed by the regular expression s.
r|s Either an r or an s.
#<n># Inserts an end node causing regular expression matching to stop when reached. The value n is returned.