membphis commented on issue #1574:
URL: https://github.com/apache/apisix/issues/1574#issuecomment-711447339


   you can take a look at this, it can help you:
   
   https://github.com/api7/lua-resty-radixtree#synopsis
   
   ```lua
           -- try to match
           local opts = {
               host = "foo.com",
               method = "GET",
               remote_addr = "127.0.0.1",
               vars = ngx.var,
           }
           ngx.say(rx:match("/aa", opts))
   
           -- try to match and store the cached value
           local opts = {
               host = "foo.com",
               method = "GET",
               remote_addr = "127.0.0.1",
               vars = ngx.var,
               matched = {}
           }
           ngx.say(rx:match("/name/json/foo/bar/gloo", opts))
           ngx.say("name: ", opts.matched.name, " other:", opts.matched.other)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to