Skip to content

Instantly share code, notes, and snippets.

@gardnervickers
Created December 12, 2016 17:50
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 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