The Policy Hub allows you to automatically identify specific content, media, or documents across your web pages. Within the hub, you can create policies with customized rules to locate elements site-wide.
Creating a Policy
- Hover over the sidebar, and select Policy Hub.
- Click Add Policy.
- Select a desired policy type among Content, Media, and Document, then click Next.
Note: Learn more about the available rules for each policy type to select the right policy. - Enter the Policy Name, and select its priority in the Set Priority field. Priorities help you quickly identify the most important policies in the Policy List.
- Click + New Rule to add rules to your policy.
-
Select a rule from the Rule Type drop-down menu, and a match condition from the Match Type drop-down menu.
Note: You can use regex (regular expressions) to create match conditions. Learn more about using regex in your rules.
-
(Optional) To add more rules to your policy, click + New Rule. Then locate and select the AND/ OR connector between your rules:
- AND: Only identify content that matches both rules.
- OR: Identify content that matches either one of the rules.
Note: You can add up to three rules. Learn more about applying the AND/ OR connector to your rules.
- Click Next.
- Enter the website you want to add this policy to.
- Click Add Website.
- Select your website, then click Next.
- After reviewing your policy, click Confirm & Create.
Applying the AND/OR Connectors to Your Policy
Below are some case examples of how to use the AND/OR connectors.
Using AND Connectors for All Rules
Use the AND connector to return items matching both adjacent rules. When you use multiple AND connectors in a row, all connected rules must be true for items to be retrieved. In this example, it will identify all the image and video files that are greater than 50MB on your selected website.
Using OR Connectors for All Rules
Use the OR connector to return items that match any of the rules you add. In this example, it will identify all image files, video files, or any media files that are greater than 50MB on your selected website.
Using AND and OR Connectors for Rules
With AND and OR connectors, you can create flexible search conditions that require only one of the conditions to be true. In your first condition, you can connect two rules by using an AND connector. Then, add a second condition using the OR connector.
In this example, the policy will identify content if it is an image file or a video file that is greater than 50MB.
Using Regex in Rules
A regex is a text string that can be used to create powerful rules to find, filter, or flag specific content on your website. Regex can be used as a Match Type for the following text-based rule types:
- Content Match
- HTML Match
- Link Match
- Media File Name
- Image Alt Text
- Document Name
In this example, the policy will identify text with “abc” that is immediately followed by exactly three digits.
Applying Regex to Your Policy
The table below includes some of the most common policies.
Search Goal |
Regex Policy |
Example Match Value |
| Literal Dot | \. |
Matches a literal period. |
| Exclude Digits | [^0-9]+ |
Matches any text that does not contain numbers. |
| Emojis/Astral Symbols | \uD83D\uDE00 |
Matches the 😀 emoji specifically. |
| Exact String | ^Regex Policy Page$ |
Matches only "Regex Policy Page", with nothing before or after. |
| Starts With | ^div |
Matches any string beginning with "div" (like <div>). |
| Hyperlink Patterns | https?://[^"]+ |
Matches URLs starting with http:// or https://, followed by any characters that are not a double quote ("). |
| Media Files | \.(mp4|webm|avi|mov|mp3|wav) |
Matches the specified video or audio file extensions. |
| Surrounded Text | [^"]cat[^"] |
Matches "cat" only when it is not inside double quotes. |
| Repeating Letters | a{2,5} |
Matches "aa", "aaa", "aaaa", or "aaaaa". |
| Sequence + Digits | abc\d{3} |
Matches "abc" followed by exactly 3 digits (e.g., abc123). |
Key Concepts for Regex Rules
To make the most of Regex in the Policy Hub, keep three fundamental rules in mind:
-
Escaping Special Characters: Characters like
.,?,*, and(have special meanings in Regex. If you want to search for the character itself, you must "escape" it with a backslash (\). -
Anchors (
^and$): Anchors tell the engine where in the string the match must occur.-
^(Caret): The match must start at the very beginning of the line. -
$(Dollar): The match must occur at the very end of the line.
-
-
Quantifiers and Ranges: When you see curly braces
{ }, you are telling the engine how many times to look for a character.
Understanding the Policy Type
The Policy Hub provides different types of policies, including Content, Media, and Document. Each policy type allows you to configure specific sets of rules to create a custom scanning policy for your website. See the table below for the available rules for each type.
| Policy Type | Description | Rules Available |
| Content | Find elements of a web page, including the title, URL, text on the page, meta descriptions, link text, and overall page structure. | Content Match: Checks for specific content within the text of the web page. |
| HTML Match: Checks for specific HTML structures or elements. | ||
| Link Text: Checks for specific links with text on the web page. | ||
| Media | Find information regarding files, including the type of file, where it is stored, when it was uploaded, and the pages that link to it. | Media File Type: Check if the media file type matches the specified criteria. |
| Media File Name: Check if the media file name matches the specified criteria. | ||
| Image File Size: Check the size of the media file. | ||
| Image Alt Text: Check for specific alt text in images. | ||
| Document |
Find documents related to the type of document, its location, size, upload date, and pages that link to it. |
Document Type: Check if the document type matches the specified criteria. |
| Document Name: Check if the document name matches the specified criteria. | ||
| Document Size: Check the size of the document. |