Are patterns or regexs allowed in route definitions?


#1

Is it possible to use string patterns or regular expressions in route definitions similar to how Express handles their route paths?

https://expressjs.com/en/guide/routing.html

For my purposes I can probably just use middleware to achieve my goal but I was curious if it was possible. I know many frameworks allow this functionality in their routing engines so I wanted to make sure I wasn’t overlooking something in the docs.

Thanks again,
-B


#2

Yes, Adonis uses path-to-regexp, so simply follow their docs for regex


#3

Ah, great. Thanks again!