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.

For example, you use Outlook to read your mail. Since AntiSpam 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've created called SPAM. To do this, Create a new rule, such as Rule 4, where the Subject Text Contains \[SPAM\] OR \[s\], the Action Type is Move to Mailbox, and the Target is SPAM.