Skip to content

Instantly share code, notes, and snippets.

@luxbock

luxbock/core.clj Secret

Last active December 31, 2015 15:49
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 luxbock/dc84ef7d4a34f80c6af9 to your computer and use it in GitHub Desktop.
Save luxbock/dc84ef7d4a34f80c6af9 to your computer and use it in GitHub Desktop.
(defn re-not-match?
"Takes a regular expression and returns a predicate function that
returns true if the regex does not match the string"
[re]
(partial
(complement
(fn [re s]
(true? (re-matches re s)))) re))
user> (filter (re-not-match? #"\d+") ["abc" "555" "123" "heh"])
("abc" "555" "123" "heh")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment