Content manager support for regular expressions – Google Message Security for Google Apps Administration Guide User Manual
Page 224

224
Message Security for Google Apps Administration Guide
Content Manager Support for Regular Expressions
Content Manager provides robust support for regular expressions. However,
because Content Manager filters large volumes of email messages, it does not
support all regular-expressions syntax standards or features.
Regex Syntax Support
There are many variations of regular-expressions syntax and features. Content
Manager supports only the POSIX Extended Regular Expressions (ERE)
standard and shorthand notation for some character classes. It doesn’t support
other standards, such as Perl or .NET regular expressions.
Case Sensitivity in Regular Expressions
Content Manager ignores case for letters and character sets in regular
expressions, so you need not specify both lowercase and uppercase letters in
your expressions. For example, if your regular expression includes the character
set
[a-z]
, it matches any lowercase character from a to z and any uppercase
character from A to Z.
Similarly, if you include literal characters or words in your regular expression, the
expression matches both lowercase and uppercase letters, regardless of the case
you use. For example, if your expression includes the literal text
viagra
, it
matches VIAGRA, Viagra, ViAgrA, and so on.
Complexity (Component) Limitations
To ensure that content filters with regular expressions do not cause processing
delays for your email, Content Manager limits the complexity of regular
expressions. A regular expression can have up to 100 components. Content
Manager considers each special character, character set, and string of literal
characters as a separate component. For example, the regex
\Wc[i|!]alis\W
contains the following 9 components: \W , c , [ , i , | , ! , ] , alis , \W
Regex Character Limitations
Content Manager does not support regular expressions with the following special
characters, because they could cause delays in processing your email:
•
* (asterisk): Matches 0 or more occurrences of the preceding item
•
+ (plus sign): Matches 1 or more occurrences of the preceding item