Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 在uri中使用偶数/奇数或正则表达式的HAProxy_Regex_Uri_Haproxy - Fatal编程技术网

Regex 在uri中使用偶数/奇数或正则表达式的HAProxy

Regex 在uri中使用偶数/奇数或正则表达式的HAProxy,regex,uri,haproxy,Regex,Uri,Haproxy,我想根据奇数/偶数设置一些关于查询参数URI的规则,例如: $ curl -I 'localhost:10001/test/?id=1' # use one backend $ curl -I 'localhost:10001/test/?id=2' # user another back-end 我可以使用ACL获取id号,如: acl has_id urlp(id) -m bool 但是我甚至不能使用功能,我不理解文档 此外,我可以将id与一些数字进行比较,如下所示: acl

我想根据奇数/偶数设置一些关于查询参数URI的规则,例如:

$ curl -I 'localhost:10001/test/?id=1' #  use one backend
$ curl -I 'localhost:10001/test/?id=2' #  user another back-end
我可以使用ACL获取id号,如:

acl has_id  urlp(id) -m bool
但是我甚至不能使用
功能,我不理解文档

此外,我可以将id与一些数字进行比较,如下所示:

acl has_id  urlp(id) -m int ge 666
但看不出是奇数还是偶数

我还尝试使用
path\u reg
,但这不适用于uri,只适用于path。

适用于:

acl是奇数urlp\u val(id)奇数-m找到


使用
urlp\u val
将值转换为整数\m/

可能
urlp(id),甚至-m bool
。转换器前面有第一个参数。Michael,够近了,谢谢!