summaryrefslogtreecommitdiffstats
path: root/src/tests/keywords/regex-lhs
blob: 91b0b2078b59839d09920ddb89ab14dbf1f0a14c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
#  PRE: update if regex-escape
#

#
#  Strings which are expanded in a regex have regex special
#  characters escaped.  Because the input strings are unsafe.
#
update request {
	Tmp-String-0 := "example.com"
	Tmp-String-1 := "^foo$bar"
}

if (&Tmp-String-0 !~ /example\.com$/) {
	update reply {
		Filter-Id := "fail 1"
	}
}
elsif (&Tmp-String-1 !~ /\^foo\$bar/) {
	update reply {
		Filter-Id := "fail 1"
	}
} else {
	update reply {
		Filter-Id := "filter"
	}
}