Fortinet 674 FortiWeb 5.0 Patch 6 Administration Guide
Table 61:Popular FortiWeb regular expression syntax
Notation Function Sample Matches
Anything
except
*.|^$?+\(){}[]
Literal match, except if the character is part of
a:
• capture group
• back-reference (e.g. $0 or \1)
• other regular expression token (e.g. \w)
Text : My cat catches things.
Regular expression: cat
Matches: cat
Depending on whether the
feature looks for all instances, it
may also match “cat” in the
beginning of “catches”.
\Escape character. If it is followed by:
• An alphanumeric character, the
alphanumeric character is not matched
literally as usual. Instead, it is interpreted as
a regular expression token. For example, \w
matches a word, as defined by the locale.
• Any regular expression special character:
*.|^$?+\(){}[]\
this escapes interpretation as a regular
expression token, and instead treats it as a
normal letter. For example, \\ matches:
\
Text : /url?parameter=value
Regular expression: \?param
Matches: ?param
(?i) Turns on case-insensitive matching for
subsequent evaluation, until it is turned off or
the evaluation completes.
Text : /url?Parameter=value
Regular expression: (?i)param
Matches: Param
Would also match pArAM etc.
\n Matches a new line (also called a line feed).
Microsoft Windows platforms typically use \r\n
at the end of each line. Linux and Unix
platforms typically use \n. Mac OS X typically
uses \r
Text : My cat catches things.
Regular expression: \n
Matches: The end of the text on
Linux and other Unix-like
platforms, only part of the line
ending on Windows, and nothing
on Mac OS X.
\r Matches a carriage return. Text : My cat catches things.
Regular expression: \r
Matches: Part of the line ending
on Windows, nothing on
Linux/Unix, and the whole line
ending on Mac OS X.