Pattern Matching Syntax
used for specifying matching conditions
used for specifying matching conditions
Within the Reblaze interface, there are several features that require matching conditions to be specified.
The text boxes accept strings or PCRE (Perl Compatible Regular Expressions). If you are unsure of PCRE syntax, you can test your expression at sites such as https://regex101.com, which will show you how it will be parsed.
Below are some examples of syntax for specifying matching patterns.
A common pattern is for matching all static content. This pattern in full is:
Functionality
Syntax
Remarks
Match /Images/ or /images/ or /IMAGES/
~* /images/
Case insensitive, regular expression matching.
Match URLs that ends with .DOC or .PDF
~ \.(DOC|PDF)$
Case sensitive, regular expression matching.
Match URLs that ends with .gif or .jpg
~* \.(gif|jpg)$
Case insensitive, regular expression matching.
Match exact URL, e.g. Root / or /admin
= /
or = /admin
Searching stops immediately (this match is top priority).
Match all URLs starting with /documents/
/documents/
System will continue search for a regular expression match. This will be matched only if none will be found.
Prioritize URLs starting with /documents/
^~ /documents/
^~ means - match and halt searching, i.e. regular expressions will not be checked.
Match 'entire site' (anything else)
/
Matches any URL since all begins with "/". However, regular expressions and longer entries will take priority.