Skip to content

Instantly share code, notes, and snippets.

@fogus
Created November 8, 2010 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fogus/668275 to your computer and use it in GitHub Desktop.
Save fogus/668275 to your computer and use it in GitHub Desktop.
(let [m (re-matcher #"(\d{1,2})\/(\d{1,2})\/(\d{4})" "12/02/1975")]
(when (.find m)
(let [[_ m d] m]
{:month m :day d})))
;=> {:month "12", :day "02"}
; BOO!!!!
(re-find (re-matcher #"(\d{1,2})\/(\d{1,2})\/(\d{4})" "12/02/1975"))
;=> ["12/02/1975" "12" "02" "1975"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment