XRule: Search Code
Use the Search Code rule to check any text-based document on your website for the presence of specific text in the content or in the HTML markup. For example, if the name of one of your products changes, you can create a specific rule that searches for the old product name.
Search Code will find the product name in the content and any HTML comments that a developer might have added, as shown in the following example:
<p> MyProductName does
not normalize the critical pages across or within jobs. This allows
an organization to define different criteria for critical pages across
its web properties, but still have them identified on a <a href="www.example.com/ MyProductName/dashboard.asp"> MyProductName dashboard</a>.</p>
The search also checks JavaScript™ files included within your HTML files.
The text fields in the template XRules all accept regular expressions if they are preceded by regexp:. They do not accept DOS expressions.
Page element | Description |
---|---|
Name | The name assigned to the XRule. |
Description (optional) | Describe the purpose of the XRule so that users can understand what it is searching for. For example, "Search for profanity in text" or "Search for profanity in the HTML code". |
Search term (text or pattern) | Enter the text that must be found within the page content or markup. Use plain text or regular expressions (prefix with regexp:). |
Make the search case sensitive | Select this option if you want the search to be case sensitive. To find a match, the search criteria and the item found must be exactly the same. For example, if you entered www.example.com/Products/ASE/ as the search term and made it case sensitive, the XRule would not find www.example.com/products/Ase/. |
PageComponent types to search | Select the type of PageComponent the scan should search for a specific term. For example, if you know that the term can only be found in JavaScript files, then choose that as the type. Limiting the document types that are searched reduces the time the scan takes to search for the term. |
Only enable XRule if it is required by a job or a report | Make this rule run only when it is required by a job or report. This method is the most efficient way to use an XRule. XRules that are unnecessarily run increase the time it takes to scan your site or generate report packs. |
Always enable XRule | Have the XRule run whenever the job runs, even though the job might not require its data. This method is the least efficient way to use an XRule. |
Always disable XRule | Disable the XRule from a job or report. The rule will never be run, even if it is required. You would disable the XRule when it causes problems with the job, such as a scan continuing indefinitely. |
This rule defines a privacy statement | Select this option when you want the pages that do not match this rule to be automatically reported in the Pages Collecting PII without a Privacy Statement Link Report. |