Subject Regular Expressions Syntax

The Subject Regular Expression field allows you to enter values in the Python Regular Expressions (RE) syntax.

For example, to create a DLP policy rule to find emails that contains the string [secure] in the email subject, add (?i)\[secure] or \[secure] where (?i) is used to specify that it is case insensitive to the Subject Regular Expression field in the policy.

To create a DLP policy rule to find emails that contain either the exact strings [secure] or [encrypt] in the email subject, you can add either \[secure\]|\[encrypt\] or ex \[secure]|\[encrypt] to the Subject Regular Expression field in the policy.

For more information, see Python regular expressions documentation.

The symbols for the start (^) and end ($) of a line are not supported. See Unsupported Regex Patterns in DLP.

To create a DLP policy rule that detects emails containing the exact word sec in the email body (but not words like Security or Seconds), regardless of whether it's at the beginning of a sentence or separated by spaces or tabs, you can use the boundary marker \b. For example, use \bsec\b.