Content Rule Builder BETA

The purpose of this tool is:
  1. Explain what is meant by the different parts of the URL,
  2. See the "URL breakdown" option to get an example.
  3. The most common scenarios for content switching,
  4. For example matching on host or path.
  5. The most common scenarios for modifying headers,
  6. For example change a host header or change a user agent string.
See left hand menu for common scenarios

URL Breakdown

Enter a full FQDN including "http://" to see an example of the different parts of a URL:

Common Regex Syntax

Syntax meaning Syntax Regex Match Expected Match
Start/Stop regex / /^www\.orig\.domain\.com$/ www.orig.domain.com
Start Selection ^ /^www\.orig\.domain\.com$/ www.orig.domain.com
End Selection $ /^www\.orig\.domain\.com$/ www.orig.domain.com
Next character is literal, not a regex character \ /^www\.orig\.domain\.com$/ www.orig.domain.com
Single Character . /^t.s.s.r.n.$/ teststring
. /^.e.t.t.i.g$/ teststring
Single Digit \d /^teststring\d\d\d$/ teststring123
Any word character (equal to [a-z A-Z 0-9 _ ]) \w /^teststrin\w\w\w3$/ teststring123
Wildcard (regex any single character = ".", 0 or more times = "*") .* /^teststr.*/ teststring123

Capture Groups, for example (ABC)(XYZ)(.*)
To capture something it needs to be in parentheses "( )",
each capture group is numbered starting with 1, the syntax to use this capture group is "/#" e.g. /1, /2, /3 etc
Regex Match String Regex Replace with Expected Output
To reuse capture group 1 "(orig)", the syntax is /1 (orig) /^www\.(orig)\.(domain)\.(com)$/ /1.company.net orig.company.net
To reuse capture group 2 "(domain)", the syntax is /2(domain) /^www\.(orig)\.(domain)\.(com)$/ new./2.net new.domain.net
To reuse capture group 3 "(com)", the syntax is /3(com) /^www\.(orig)\.(domain)\.(com)$/ new.company./3 new.company.com