With DLP Advanced Patterns, you can use Regular Expressions and create rules to prevent data loss. To prevent data loss, in these rules, you can include specific terms that are sent through your environment.
IMPORTANT: Technical Support
does not support coding and debugging Regular Expressions.
Regular Expressions for Advanced Patterns:
The DLP Advanced Patterns use regular expressions (
regex) to allow complex pattern match. DLP advanced pattern definitions use the Google
RE2 regex syntax. By default, the regular expressions are case-sensitive. A full description of RE2 syntax is beyond the scope of this document.
The following table lists some of the most common
regex:
Regular Expression |
Description |
[abc] |
Matches a single character a, b, or c |
[^abc] |
Matches a single character, excluding a, b, and c |
[0–9] |
Matches a single character in the range of 0–9 |
[^0–9] |
Matches a single character that isn't in the range of 0–9 |
(ab|cd) |
Matches ab or cd |
\d |
Matches any ASCII digit |
\D |
Matches any non-digit character |
\s |
Matches any whitespace character |
\S |
Matches any non-whitespace character |
\w |
Matches any alphanumeric character |
\W |
Matches any non-alphanumeric character |
\b |
ASCII word boundary |
\ (when used with punctuation, for example \] |
Matches ] (Escapes the next character, that is, removes its special meaning.) |
. |
Any single character |
* |
Modifies the previous token to match 0 or more times |
+ |
Modifies the previous token to match 1 or more times |
{3,4} |
Modifies the previous token to match 3 or 4 times |
? |
Modifies the previous token to match 0 or 1 time (makes it optional) |
(?i) |
Sets matching to be case-insensitive up to the next closing) (Accounts for nested () for example ((?i)insensitive)sensitive |
(?-i) |
Sets matching to be case-sensitive up to the next closing ) |
Create a regex-based definition
As an example, consider you want to add a regex pattern to block a document that has a credit card number. The credit card number format is xxxx-xxxx-xxxx-xxxx, where
x is any digit (0–9) that occurs more than 10 times.
To add the regex pattern, perform the following steps:
- Log on to the ePolicy Orchestrator console.
- From the Menu, select Classification under Data Protection.
- In the Classification page:
- Click the Definitions tab.
- Under Advanced Pattern, click Actions, and select New Item.
- In the New Advanced Pattern page:
- Name: Enter a name for the advanced pattern.
- Description: (Optional) Provide a description.
- Matched Expressions:
Expressions: Enter \d{4}(-|\s)\d{4}(-|\s)\d{4}(-|\s)\d{4}\D.
Description: Provide the description.
Validator: Select Luhn 10 (remainder 0).
Score: Set the score to 1.
Click Add.
- Ignored Expressions: Specify the credit card numbers that you want to ignore.
- Click Save.
- Click the Classification tab, click Actions under the Classification panel, and select New Classification.
- In the New Classification page:
- Enter a name for the classification and provide the description (optional).
- Click Save.
- Select the classification that you created, click Action, and select New Content Classification Criteria.
- Enter a name for the classification criteria.
- Click Advanced Pattern in the left panel.
- Set the Comparison to One of (OR), All of (AND), or None of (Not).
- Click (…), select the pattern you created in step 3 and set the Threshold to 10.
- Click OK.
- Assign the classification to a rule.