---
schema_version: "1"
id: 71c3c3569166cc83cc534b41cc1f686fa9ea8bed7cf57306d803c7f01f52a3ba
title: Use Custom Patterns in Data Detect Scan Policies
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/data_detect_custom_regex.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.data_detect_custom_regex.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e0080c7402edaa2103303f2f617f4ef2bcdc0ce99520dd88c63825e7d2cc503a
description: Use regular expressions to define your own custom patterns for detecting sensitive data for each Data Detect scan policy in addition to the provided sensitive data categories. Some custom patterns that you can use include organization-specific information such as student IDs, employee IDs, or contract numbers. Scan results include instances of the custom patterns detected.
products:
  - Salesforce Platform
  - Cross Cloud
release: "264"
---
# Use Custom Patterns in Data Detect Scan Policies

Use regular expressions to define your own custom patterns for detecting sensitive data for each Data Detect scan policy in addition to the provided sensitive data categories. Some custom patterns that you can use include organization-specific information such as student IDs, employee IDs, or contract numbers. Scan results include instances of the custom patterns detected.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> editions with the Salesforce Shield or Data Detect Licenses.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d150534e73">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d150534e73 ">To create, edit, and view Data Detect policies</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d150534e73 ">Manage user access to Data Detect feature</td>

          </tr>
        </tbody>
      </table>

Add up to 10 regular expressions (custom patterns), plus 10 keywords, in any combination.

1. From the Data Detect Policies page, select a policy, select **Detection Criteria**, then select **Custom Patterns**. Select **Add Pattern**.
2. Provide a descriptive name for the regular expression, and then enter the regular expression syntax.
    
    You can optionally test your regular expression to see if it can identify what you want it to detect in the Validate regular expression section. Ensure your regular expression pattern or sample phrase is entered correctly for the validation to work.
3. Enter an example of a phrase or sentence containing the pattern that you want to find, and select**Validate**. Review the validation output to see whether the pattern is correctly identified and redacted.
4. When you’re done entering your patterns, save your work. You can come back to this section later to edit or delete a regular expression from the drop-down menu.