Nginx〜和〜*正则表达式有什么区别?


11

Nginx ~和正则~*表达式有什么区别?

例如:

if ($http_referer ~* www.foobar.net) {
    ...
}

if ($http_referer ~ www.foobar.net) {
    ...
}

Answers:


19

〜:如果存在波浪号修饰符,则此位置将被解释为区分大小写的正则表达式匹配。

〜*:如果使用波浪号和星号修饰符,则位置块将被解释为不区分大小写的正则表达式匹配。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.