juxt/bidi — pull request #33 by dthume (2014-11-26 08:47:52+00:00)
Title: Support clojure/clojurescript UUIDs via bidi.bidi/uuid function

While `keyword` and `long` are extremely useful for matching route parameters, it would be great to have UUID support (particularly for anyone using datomic squuids as external identifiers in favour of `:db/id`). Sadly clojure / clojurescript core only support UUID literals - there is no (public) core function that I can find for constructing the UUID type appropriate to the platform from a string input, so this patch adds both clojure and clojurescript support for doing so via the `bidi.bidi/uuid` function, which can be used in route patterns in the same way as `keyword` and `long`.

The regex used for UUIDs is fairly conservative - it allows only version 1-5 UUIDs with a specification compliant variant. This is actually somewhat more conservative than the UUIDs allowed by java.util.UUID, so it may be more appropriate to relax the regex to simply be:

`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`

Thanks for bidi!