Chapter 15 Unified Threat Management for FortiOS 5.0 : Other Security Profiles considerations : Using wildcards and Perl regular expressions : Regular expression vs. wildcard match pattern
  
Regular expression vs. wildcard match pattern
A wildcard character is a special character that represents one or more other characters. The most commonly used wildcard characters are the asterisk (*), which typically represents zero or more characters in a string of characters, and the question mark (?), which typically represents any one character.
In Perl regular expressions, the ‘.’ character refers to any single character. It is similar to the ‘?’ character in wildcard match pattern. As a result:
example.com not only matches example.com but also examplea.com, exampleb.com, examplec.com, and so on.
 
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, example\\.com.
To match a special character such as '.' and ‘*’ use the escape character ‘\’. For example:
To match example.com, the regular expression should be: example\.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:
exam*.com matches exammmm.com but does not match example.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 exam*.com should therefore be exam.*\.com.