A MatchComparator that tries to intelligently choose the best match.
It will prefer matches that consume the most of the input URL string.
However, as a tie breaker, it will also consider the number of dynamic
captures and preferentially choose the result with fewer captures.
For example, consider these two paths:
path("/users/all")
path("users", string("id"))
Both paths will result in a successful match for the input string
"/users/all", but the first path will be considered a better match.
A
MatchComparatorthat tries to intelligently choose the best match.It will prefer matches that consume the most of the input URL string. However, as a tie breaker, it will also consider the number of dynamic captures and preferentially choose the result with fewer captures.
For example, consider these two paths:
path("/users/all")path("users", string("id"))Both paths will result in a successful match for the input string
"/users/all", but the first path will be considered a better match.