Skip to content

Instantly share code, notes, and snippets.

@gardnervickers
Created December 12, 2016 17:50
Show Gist options
  • Save gardnervickers/4018bd3f8b51f553cf399d5fd2313d5a to your computer and use it in GitHub Desktop.
Save gardnervickers/4018bd3f8b51f553cf399d5fd2313d5a to your computer and use it in GitHub Desktop.
(let [s (re-seq #"\d+" "401-477-0248")]
(println (reduce (fn [acc v]
(if (and (seq acc)
(every? (fn [pastv]
(= pastv ["" nil])) (take-last 10 acc)))
(reduced acc)
(conj acc v))) [] s)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment