Fortinet white logo
Fortinet white logo

Administration Guide

Example regular expressions

Example regular expressions

Note

Depending on where you want to match in an email or SMTP session, you may need to add syntax to the following patterns in order to match a whole line, or only at the start and/or end of text. For example, to compare the pattern to an entire line:

^pattern$

Email addresses

Email address user names are often a mix of letters, numbers, and possibly periods ( . ).

[[:alnum:].]*@example\.com

Alternative words in a phrase

/word1|word2|word3/

Purposefully misspelled words

Spammers often insert other characters between the letters of a word to avoid detection by antispam software, or replace characters with similar-looking numbers, punctuation, or characters in another language.

.*v.*i.*a.*g.*r.*
cr[eéèêë3]*dit [sS§5]c[oO0]re

Common spam phrases

Number of spaces, characters, and punctuation may vary.

try it for fr[e]+
student[ _-]*loans
you[’`"']re already approved
special[ _;!%~#§£@°()\+\-\*\.]*offer

Example regular expressions

Example regular expressions

Note

Depending on where you want to match in an email or SMTP session, you may need to add syntax to the following patterns in order to match a whole line, or only at the start and/or end of text. For example, to compare the pattern to an entire line:

^pattern$

Email addresses

Email address user names are often a mix of letters, numbers, and possibly periods ( . ).

[[:alnum:].]*@example\.com

Alternative words in a phrase

/word1|word2|word3/

Purposefully misspelled words

Spammers often insert other characters between the letters of a word to avoid detection by antispam software, or replace characters with similar-looking numbers, punctuation, or characters in another language.

.*v.*i.*a.*g.*r.*
cr[eéèêë3]*dit [sS§5]c[oO0]re

Common spam phrases

Number of spaces, characters, and punctuation may vary.

try it for fr[e]+
student[ _-]*loans
you[’`"']re already approved
special[ _;!%~#§£@°()\+\-\*\.]*offer