ngx_lua location capture issue

Nginx User nginx at
Thu Oct 20 10:48:18 UTC 2011

On 20 October 2011 11:46, agentzh <agentzh at> wrote:
> On Thu, Oct 20, 2011 at 4:17 PM, Nginx User <nginx at> wrote:
>>> Why not put your Lua code into an external .lua file and use
>>> access_by_lua_file or rewrite_by_lua_file instead? That way you only
>>> need to escape each "\" only once.
>> I am using an external .lua file and I only get consistent results
>> when I use "\\\s" etc. "\\s" etc resulted is several ")" expected near
>> "|" type messages.
> "\\\s" is essentially equivalent to "\\s" in Lua string literals
> because "\s" evaluates to "s".
Would the Nginx string literal you mentioned before not then turn
"\\s" into "\s" ... which is were I want to be in the end? I suspect I
am missing something in the process.

Wish I could just use the familiar "\" and have it figured out in the
background without me having to worry about it as rewrite apparently
does though.

More information about the nginx mailing list