EasyManua.ls Logo

Fortinet Fortigate-5000 series - Example Regular Expressions

Fortinet Fortigate-5000 series
458 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Antispam Using Perl regular expressions
FortiGate Version 3.0 MR4 Administration Guide
01-30004-0203-20070102 395
Example regular expressions
To block any word in a phrase
/block|any|word/
To block purposely misspelled words
Spammers often insert other characters between the letters of a word to fool spam
blocking software.
/^.*v.*i.*a.*g.*r.*o.*$/i
/cr[eéèêë][\+\-
\*=<>\.\,;!\?%&§@\^°\$£€\{\}()\[\]\|\\_01]dit/i
To block common spam phrases
The following phrases are some examples of common phrases found in spam
messages.
/try it for free/i
/student loans/i
/you’re already approved/i
/special[\+\-
\*=<>\.\,;!\?%&~#§@\^°\$£€\{\}()\[\]\|\\_1]offer/i
100\s*mk The strings “100” and “mk” optionally separated by any amount of white
space (spaces, tabs, newlines)
abc\b “abc” when followed by a word boundary (for example, in “abc!” but not in
“abcd”)
perl\B “perl” when not followed by a word boundary (for example, in “perlert” but
not in “perl stuff”)
\x Tells the regular expression parser to ignore white space that is neither
preceded by a backslash character nor within a character class. Use this
to break up a regular expression into (slightly) more readable parts.
/x Used to add regular expressions within other text. If the first character in
a pattern is forward slash '/', the '/' is treated as the delimiter. The pattern
must contain a second '/'. The pattern between ‘/’ will be taken as a
regular expressions, and anything after the second ‘/’ will be parsed as a
list of regular expression options ('i', 'x', etc). An error occurs If the
second '/' is missing. In regular expressions, the leading and trailing
space is treated as part of the regular expression.
Table 42: Perl regular expression formats (Continued)

Table of Contents

Related product manuals