Fork me on GitHub

@meow: Since we are dealing with conventionally structured text[1], I tried another way.

(let [allowed-filetypes #{"clj" "cljc" "cljs"}]
  (filter #(allowed-filetypes (last (re-seq #"\w+" %)))
          ["~/bin/" "/to/file-root/" "~/baz.quxx.clj" "file:///gurk.phew.c" "file:///baz.munge.cljc" "file:///foo.baz.html"]))
[1] A file extension is always the last part of the filename, and always dot separated. IMHO, this also feels more robust, maintainable, and extensible than the regex alternative (only for this structured text use case).