Creating Rules Using Regular Expressions

The expressions for each element of a delivery rule are shown in the following table.

Message Areas

Expression

From:

F

Subject:

S

Sender:

N

To:

T

Entire Header (everything preceding the body)

H

Entire Body of Message

B

Condition

Expression

contains

~

does not contain

!~

equals

=

does not equal

!=

Text Pattern

Expression

Any character

.

Any of the values separated by vertical bars within the parentheses; the vertical bar represents "or"

(this|that|other)

Any word character (a-z, A-Z, 0- 9)

\w

Any non-word character

\W

Any digit (0- 9)

\d

Any non- digit

\D

Any white space (spaces and/or tabs and/or carriage returns

\s

Any non-white space

\S

Any punctuation character (any character other than \w or \s)

\p

Any non-punctuation character

\P

Quantifier

Expression

Zero or more

*

One or more

+

Exactly 100

{100}

At least n1, but not more than n2 (where n1 and n2 are numbers)

{n1,n2}

Note: The following characters have special meaning in a rule: {} () | * + , . : \ [] ^ $  If you want to use one of these characters in a search string, precede it with a backslash. For example, to search for a plus sign, enter \+ in the search string.

Example

You use Outlook to read your mail. Anti-spam identifies spam by inserting the word SPAM into the X-Header, and Outlook labels spam by inserting "[s]" into the header, you may wish to route these messages to a folder you have created called SPAM.

To do this