Support regex matching with attr (#2258)

* Support regex matching with attr

* Add test case

* Optimizing regex parsing at core start

* simpliy
This commit is contained in:
yuhan6665 2023-06-27 04:04:09 -04:00 committed by GitHub
parent 07389eca96
commit a6c5c57930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 7 deletions

View file

@ -319,6 +319,19 @@ func TestRoutingRule(t *testing.T) {
},
},
},
{
rule: &RoutingRule{
Attributes: map[string]string{
"Custom": "p([a-z]+)ch",
},
},
test: []ruleTest{
{
input: withContent(&session.Content{Attributes: map[string]string{"custom": "peach"}}),
output: true,
},
},
},
}
for _, test := range cases {