Skip to content

formatted

Myles Megyesi edited this page Oct 6, 2012 · 3 revisions

Usage

(defvalidator user-validator
  [:name :formatted {:pattern #"[A-Z]+" :message "is not capitalized"}])

(user-validator {:name "Dave"})
; {:name ["is not capitalized"]}

(user-validator {:name "DAVE"})
; {}

Options:

  • :pattern A Regex Pattern to match against. Default #"".

Default error message:

"has the incorrect format"

Clone this wiki locally