Skip to content

Instantly share code, notes, and snippets.

@brehaut brehaut/gist:888932
Created Mar 27, 2011

Embed
What would you like to do?
(->> (re-seq #"(?i)(\d+)\.|(yes|no)" "no1. asdf\n\nasdf foo yes2.\n\nfsdf\nno yes no")
(map rest)
(partition-by first)
(drop-while (comp nil? ffirst))
(partition 2)
(map (fn [s] (let [[i & r] (keep identity (flatten s))]
[(Integer/parseInt i)
(-> (last r) .toLowerCase first (= \y))])))
(into {}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.