Fortinet 5.0 Patch 6 Microscope & Magnifier User Manual


 
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
mak
es it opt
ional.
Does not match if there is not at least 1
instan
ce.
Text: www
.example.com
Regu
lar expression: w+
Matches: www
Wo
uld also match “w”, “ww”,
“wwww”, or any number
of
uninterrupted repetitions of the
character “w”.
* Repeatedly matches the previous character or
ca
ptur
e 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
Regu
lar expression: .*
Matches: www.
example.com
All of any text, except line
endings (\r and \n).
Te
xt: www.example.com
Regu
lar expression: (w)*?
Matche
s: www
Wo
uld also match common
typ
os 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.
? ex
cept
when
followe
d by
=
Makes the preceding character or capture
gr
oup 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
captur
e 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
Regu
lar expression:
p(?=
arameter)
Matches: p, but only in
“param
eter, not in “pack”, which
does not end with “arameter”.
Table 61:Popular FortiWeb regular expression syntax
Notation Function Sample Matches