If a regex uses capturing groups, path parameters following the pattern get assigned values from the captured group, not the value from the path.
;; Clout version 2.1.2
(clout/route-matches (clout/route-compile "/:foo/:bar" {:foo #"a(bcd|ef)g"})
(mock/request :get "/abcdg/1"))
=> {:bar "bcd", :foo "abcdg"}
expected:
=> {:bar "1", :foo "abcdg"}
If a regex uses capturing groups, path parameters following the pattern get assigned values from the captured group, not the value from the path.
;; Clout version 2.1.2
(clout/route-matches (clout/route-compile "/:foo/:bar" {:foo #"a(bcd|ef)g"})
(mock/request :get "/abcdg/1"))
=> {:bar "bcd", :foo "abcdg"}
expected:
=> {:bar "1", :foo "abcdg"}