Firstsawyou opened a new issue #2809:
URL: https://github.com/apache/apisix/issues/2809


   ### Issue description
   
   We all know that apisix supports vars matching rules, similar to this: {var, 
operator, val}. But these rules are in the 
`apisix/deps/share/lua/5.1/resty/radixtree.lua` file, not in the public method. 
Therefore, we cannot reuse these rules. The `match` rule is a very useful 
feature. If we add the `match` rule to the `apisix/apisix/core` module, I think 
it must be very interesting.
   
   Examples of vars matching:
   
   ```
   [ "arg_name", "==", "rose" ],
   [ "http_appKey", "~~", "[a-z].+" ]
   [ "server_port", ">=", "80" ]
   ```
   
   Supported operators: `==, ~=, ~~, >, >=, <, <=, ip, ip_in`
   
   ### Operator list
   
   | Operator  | Description           |         Example             |
   |-----------|-----------------------|-----------------------------|
   | ==        | equal                 | {"arg_name", "==", "json"}  |
   | ~=        | not equal to          | {"arg_name", "~=", "json"}  |
   | ~~        | Regular match         | {"arg_name", "~~", "[a-z]+"}|
   | <         | Less than             | {"arg_age", "<", 24}        |
   | <=        | Less than or equal to | {"arg_age", "<=", 24}       |
   | >         | more than the         | {"arg_age", ">", 24}        |
   | >=        | greater or equal to   | {"arg_age", ">=", 24}       |
   
   what do you think? Welcome to discuss together.
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to