beautypg.com

Google Message Security for Google Apps Administration Guide User Manual

Page 231

background image

Content Manager

231

Match Any IP Address in a Range

Notes

\W

matches any character that’s not a letter, digit, or

underscore. It prevents the regex from matching
characters before or after the email address.

^

matches the start of a new line. Allows the regex to

match the address if it appears at the beginning of a line,
with no characters before it.

$

matches the end of a line. Allows the regex to match

the address if it appears at the the end of a line, with no
characters after it.

[\w.\-]

matches any word character (a-z, A-Z, 0-9, or

an underscore), a period, a plus sign, or a hyphen.
These are the most commonly used valid characters in
the first part of an email address. Note that the

\-

(which indicates a hyphen) must occur last in the list of
characters within the square brackets.

The

\

before the dash and period “escapes” these

characters—that is, it indicates that the dash and period
are not a regex special characters themselves. Note that
there is no need to escape the period within the square
brackets.

{0,25}

indicates that from 0 to 25 characters in the

preceding character set can occur before the @ symbol.
Content Manager supports matching of up to 25
characters for each character set in a regular
expression.

The

(...)

formatting groups the domains, and the

|

character that separates them indicates an “or.”

Usage example

Match any IP address within the range 192.168.1.0 to
192.168.1.255.

Regex
examples

1:

192\.168\.1\.

2:

192\.168\.1\.\d{1,3}