You will need to follow the compiler rule to make the route.
Playframework Documentation
Dynamic parts with custom regular expressions You can also define your own regular expression for the dynamic part using the $ id syntax:
GET /clients/$id<[0-9]+> controllers.Clients.show(id: Long)
In your case, try the following:
GET /results/$departure</?.+> @controllers.SearchController.results(departure: String)
However, you may need to make sure that this path does not overlap with other routes.
Trey lin
source share