评论者:cgag
恐怕我不知道如何编辑,但我想要包括一个简单的示例
CLJS
(clojure.string/replace "hello world" #"(hello) world" (fn ([m]) (.log js/console (str "Match: " m)) m))
将记录:"Match: hello world"
CLJ
user=> (clojure.string/replace "hello world" #"(hello) world" (fn ([m]) (println (str "Match: " m) m)))
Match: ("hello world" "hello") ("hello world" "hello")
NullPointerException java.util.regex.Matcher.quoteReplacement (Matcher.java:655)