Antispam
Using wildcards and Perl regular expressions
FortiGate Version 4.0 Administration Guide
01-400-89802-20090424
507
•
•
fortinet.com not only matches fortinet.com but also fortinetacom, fortinetbcom,
fortinetccom, and so on.
To match a special character such as '.' and ‘*’ use the escape character ‘\’. For example:
•
To match fortinet.com, the regular expression should be: fortinet\.com
In Perl regular expressions, ‘*’ means match 0 or more times of the character before it, not
0 or more times of any character. For example:
•
forti*.com matches fortiiii.com but does not match fortinet.com
To match any character 0 or more times, use ‘.*’ where ‘.’ means any character and the ‘*’
means 0 or more times. For example, the wildcard match pattern forti*.com should
therefore be fort.*\.com.
Word boundary
In Perl regular expressions, the pattern does not have an implicit word boundary. For
example, the regular expression “test” not only matches the word “test” but also any word
that contains “test” such as “atest”, “mytest”, “testimony”, “atestb”. The notation “\b”
specifies the word boundary. To match exactly the word “test”, the expression should be
\btest\b.
Case sensitivity
Regular expression pattern matching is case sensitive in the web and antispam filters. To
make a word or phrase case insensitive, use the regular expression
/i
. For example,
/bad language/i
will block all instances of “bad language”, regardless of case.
Perl regular expression formats
lists and describes some example Perl regular expression formats.
Note:
To add a question mark (
?
) character to a regular expression from the FortiGate CLI,
enter Ctrl+V followed by ?. To add a single backslash character (
\
) to a regular expression
from the CLI you must add precede it with another backslash character. For example,
fortinet\\.com
.
Содержание Gate 60D
Страница 678: ...Reports Log Report FortiGate Version 4 0 Administration Guide 678 01 400 89802 20090424 http docs fortinet com Feedback...
Страница 704: ...Index FortiGate Version 4 0 Administration Guide 704 01 400 89802 20090424 http docs fortinet com Feedback...
Страница 705: ...www fortinet com...
Страница 706: ...www fortinet com...