Fork me on GitHub
#malli
<
2020-02-13
>
eckardjf03:02:36

How could I use a custom error message for a failed regex match? Something like:

(-> [:map [:a [#"^[0-9]+$" {:error/message "should match"}]]]
    (mc/explain {:a "aaa"})
    (me/humanize))

eckardjf05:02:58

Ah, I see what I was missing - this works

[:map [:a [:re {:error/message "should match"} #"^[0-9]+$"]]]