Go to the table of contents Go to the previous page Go to the next page View or print as PDF
Standard Regular Expression Strings
Standard Regular Expression Strings
Regular expressions (RegEx) are a powerful way of matching a sequence of simple characters. You can use regular expressions in Forcepoint Email Security Cloud to create dictionary entries for lexical rules (see Filtering using lexical rules).
You can enclose a range of characters in square brackets to match against all of those characters. For example:
 
Although you can use ranges to specify a group of characters, you can also use the following shortcuts:
 
\xhh
\uhhhh
 
Note 
To match against occurrences of a character or expression, you can use the following:
 
You can provide text to replace all or part of your search string. To do this, you need to group together matches by enclosing them in parentheses so they can be referenced in the replacement. To reference a matched parameter, use $n where n is the parameter starting from 1.
Regular expression examples
Example 1: IP address
The following regular expression matches against any IP address:
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
You can test this regex with any phrase including a standard IP address, for example 192.23.44.1.
Example 2: Dates
The following regular expression matches against dates in the format DD-MMM-YYYY:
\b\d\d?-\w\w\w-\d\d\d\d\b
To test this regex, enter a sentence similar to "The project completes on 14-Feb-2009".
Example 3: Social Security Numbers
The following regular expression matches against Social Security numbers in UK format:
\b\w{2}\d{6}\w\b
You can test this regex with any Social Security number in the format XY123456Z.

Go to the table of contents Go to the previous page Go to the next page View or print as PDF
Standard Regular Expression Strings
Copyright 2023 Forcepoint. All rights reserved.