This capability requires Rules Engine - Advanced Rules which must be purchased separately. Contact your CDN account manager to activate it.
Category: URL
Purpose: Identifies requests by whether the query string of the requested URL matches the pattern defined by a Perl-compatible regular expressionThis type of value is interpreted as a regular expression that defines a pattern of characters..
Key information:
A value may be defined using any combination of numbers, letters, and/or symbols. This value will be interpreted as a regular expression. Regular expressions are useful for defining a pattern of characters.
Although regular expressions are quite powerful and can generate flexible solutions, it is strongly recommended that a regular expression statement be constructed, or at the very least proofed, by a developer on your team. This will ensure that the desired behavior will take place.
For example, specifying a ".*" regular expression will match all requests, since the specified pattern matches 0 or more characters. A clearer way to match all requests is through the use of the Always match condition.
Certain characters require URL encoding. Use the percentage symbol to URL encode the following characters:
Character | URL Encoding |
---|---|
Space |
%20 |
& |
%26 |
% |
%25 |
Matching against URLs that contain non-US-ASCII characters requires that you specify encoded Unicode characters (e.g., %E3%81%93).
Encode all Unicode characters before setting the Value option. This match condition only accepts encoded Unicode characters.
Example:
You should include the following characters instead of こんにちは when defining this match condition's value:
The majority of user agents (e.g., web browsers) encode non-US-ASCII characters in the
Curl does not encode non-US-ASCII characters. If you would like to test this match condition using curl, then you will need to create a mutually exclusive match section (i.e., IF / ELSE IF). Each conditional expression within that statement should contain this match condition with the Encoded option set to different values.
Use the Encoded option to determine whether your match value, as defined in the Value option, will be decoded prior to comparison with the request's query string. You must set this option to Yes when either of the following conditions are true:
Enabling this option ensures that your match value remains encoded.
If both of the above conditions are not applicable, then you should use the default configuration (i.e., No) which allows our service to decode your match value.
Double-escape special regular expression characters (e.g., \^$.+) to include a backslash in the regular expression.
Example:
Value | Interpreted As |
---|---|
\+ |
+ |
\\+ |
\+ |
Due to the manner in which cache settings are tracked, this match condition is incompatible with the following features: