0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-13 15:31:26 -05:00

Add uuid-str? predicate.

This commit is contained in:
Andrey Antukh 2016-09-22 22:33:04 +03:00
parent a95bd7f02a
commit d6f96c246d
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -80,6 +80,16 @@
(disj s v)
(conj s v)))
;; --- String utils
(def +uuid-re+
#"^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$")
(defn uuid-str?
[v]
(and (string? v)
(re-seq +uuid-re+ v)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Numbers Parsing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;