Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Last active December 19, 2015 01:39
Show Gist options
  • Save mwmitchell/5877300 to your computer and use it in GitHub Desktop.
Save mwmitchell/5877300 to your computer and use it in GitHub Desktop.
(defn select-int-keys [r m]
(reduce-kv
(fn [a k v]
(let [[_ n] (re-find r k)]
(if n (assoc a k [(int (read-string n)) v])
a)))
{}
m))
(select-int-keys #"bSearchable_([0-9]+)"
{"bSearchable_1" false
"bSearchable_2" true
"somethingElse" "blah"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment