Grammar Regular Expression Engine
This section describes the regular expressions syntax that the Advanced DLP add-on supports.
The DLP engine parser interprets regular expression syntax nearly identically to the UNIX regular expression syntax.
Operators
The following table describes the base regular expression operators available in the DLP engine, and the pattern the operator matches.
Operator | Matched Pattern |
\ | Quote the next metacharacter |
^ | Match the beginning of a line |
$ | Match the end of a line |
. | Match any character (except newline) |
| | Alternation |
() | Used for grouping to force operator precedence |
[xy] | The character |
[x-y] | The range of characters between |
[^z] | Any character except For performance reasons, it is recommended that you explicitly list all the characters that you want to match, rather than using this operator To use negated character classes in case-insensitive entities, you must include letters in both cases, for example [^Zz] rather than [^z] |
Quantifiers
Operator | Matched Pattern |
* | Match 0 or more times |
+ | Match 1 or more times |
? | Match 0 or 1 times |
{n} | Match exactly |
{n,1} | Match at least |
{n,m} | Match at least |
Metacharacters
Operator | Matched Pattern |
\t | Match tab |
\n | Match newline |
\r | Match return |
\f | Match formfeed |
\a | Match alarm (bell, beep, and so on) |
\e | Match escape |
\v | Match vertical tab |
\021 | Match octal character (in this example, 21 octal) |
\xF0 | Match hex character (in this example, F0 hex) |
\x{263a} | Match wide hex character (Unicode) |
\w | Match word character: |
\W | Match non-word character: |
\s | Match whitespace character. This metacharacter also includes |
\S | Match non-whitespace character: |
\d | Match digit character: |
\D | Match non-digit character: |
\b | Match word boundary |
\B | Match non-word boundary |
\A | Match start of string (never match at line breaks) |
\Z | Match end of string. Never match at line breaks; only match at the end of the final buffer of text submitted for matching |
\p{class} | Match any character that belongs to the specified Unicode character class. For example, |
\P{class} | Match any character that does not belong to the specified Unicode character class. For example For performance reasons, it is recommended that you avoid using negated character classes where possible |