Hello!
2015-02-28 3:22 GMT-08:00 刘云:
> a.lua 的内容和 /main 里的lua代码一样如下:
>
> local res = ngx.location.capture("/redis", { args = { query = "sismember a
> b\\r\\n" } } )
当放在外部 .lua 文件中时,\r 和 \n 中的 \ 就不再需要进行转义了,毕竟你的 Lua 代码不再是 nginx string 常量的内容了。直接写成
local res = ngx.location.capture("/redis", { args = { query =
"sismember a b\r\n" } } )
就可以了。
更多细节见
https://github.com/openresty/lua-nginx-module#special-pcre-sequences
Regards,
-agentzh