It creates a segment route type. There is no support yet for regex routes. There is an open issue for regex support or use another router like FastRoute. However, with FastRoute I think an optional parameter can only be followed by other optional parameters in a specific order.
So a regex could match
But you can’t have a regex for:
It’s a while since I tried this so I’m not 100% sure.