Fortinet 676 FortiWeb 5.0 Patch 6 Administration Guide
+Repeatedly matches the previous character or
capture group, 1 or more times, as many times
as possible (also called “greedy” matching)
unless followed by a question mark ( ? ), which
makes it optional.
Does not match if there is not at least 1
instance.
Text : www.example.com
Regular expression: w+
Matches: www
Would also match “w”, “ww”,
“wwww”, or any number of
uninterrupted repetitions of the
character “w”.
*Repeatedly matches the previous character or
capture group, 0 or more times. Depending on
its combination with other special characters,
this token could be either:
* — Match as many times as possible (also
called “greedy” matching).
*? — Match as few times as possible (also
called “lazy” matching).
Text : www.example.com
Regular expression: .*
Matches: www.example.com
All of any text, except line
endings (\r and \n).
Text : www.example.com
Regular expression: (w)*?
Matches: www
Would also match common
typos where the “w” was
repeated too few or too many
times, such as “ww” in
w.example.com or “wwww” in
wwww.example.com. It would
still match, however, if no
amount of “w” existed.
? except
when
followed by
=
Makes the preceding character or capture
group optional (also called “lazy” matching).
Text : www.example.com
Regular expression:
(www\.)?example.com
Matches: www.example.com
Would also match example.com.
?= Looks ahead to see if the next character or
capture group matches and evaluate the match
based upon them, but does not include those
next characters in the returned match string (if
any).
This can be useful for back-references where
you do not want to include permutations of the
final few characters, such as matching “cat”
when it is part of “cats” but not when it is part
of “catch”.
Text : /url?parameter=valuepack
Regular expression:
p(?=arameter)
Matches: p, but only in
“parameter, not in “pack”, which
does not end with “arameter”.
Table 61:Popular FortiWeb regular expression syntax
Notation Function Sample Matches