local ua = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)"
if ngx.re.find(ua, "^Mozilla/4.0 \\(compatible; MSIE 7.0; Windows NT 5.1; SV1\\)$","jo") then
ngx.say("first match")
end
if ngx.re.find(ua, "^Mozilla/4.0 \\(compatible; MSIE [0-9]", "jo") then
ngx.say("0-9 match")
end
if ngx.re.find(ua, "^Mozilla/4.0 \\(compatible; MSIE %%d", "jo") then
--if ngx.re.find(ua, "^Mozilla/4.0 \\(compatible; MSIE %d.0; Windows NT %d.1; SV1\\)$", "jo") then
ngx.say("match")
else
ngx.say("not match")
end
if ngx.re.find(ua, "^Mozilla/4.0 \\(compatible; MSIE \\%d", "jo") then
--if ngx.re.find(ua, "^Mozilla/4.0 \\(compatible; MSIE %d.0; Windows NT %d.1; SV1\\)$", "jo") then
ngx.say("match")
else
ngx.say("not match")
end