-
-
Save luxbock/dc84ef7d4a34f80c6af9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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