Reputation: 233
Is it possible to use regular expressions in Match-Path-rules to match general broader url-patterns and to be able to match very specific patterns. I dont want to use {**catch-all}
but for example an ordinary RegExp like /api/\w{1,3}-\d{1,9}
...
Is this possible to achieve with Yarp in some way?
"Match": {
"Path": "<Regular expressions here or ?>"
}
Upvotes: 2
Views: 2556
Reputation: 162
You can write something like this:
"Match": {
"Path": "/api/{path:regex(\\w{{1,3}}-\\d{{1,9}})}"
}
or
"Match": {
"Path": "/api/{folder1:regex(^\\w{{1,3}}$)}-{folder2:regex(^\\d{{1,9}}$)}"
}
Upvotes: 2