Q:

How to remove list of words from strings

What I would like to do (in Clojure):
For example, I have a vector of words that need to be removed:
(def forbidden-words [":)" "the" "." "," " " ...many more...])

... and a vector of strings:
(def strings ["the movie list" "this.is.a.string" "haha :)" ...many more...])

So, each forbidden word should be removed from each string, and the result, in this case, would be: ["movie list" "thisisastring" "haha"].
How to do this ?

A:

(def forbidden-words [":)" "the" "." ","])
(def strings ["the movie list" "this.is.a.string" "haha :)"])
(let [pattern (->> forbidden-words (map #(java.util.regex.Pattern/quote %)) 
                (interpose \|)  (apply str))]
  (map #(.replaceAll % pattern "") strings))

