由cgag发表的评论
害怕无法编辑,但我想包括一个简单的例子
CLJS
(clojure.string/replace "hello world" #"(hello) world" (fn (link: m) (.log js/console (str "Match: " m)) m))
将记录:"Match: hello world"
CLJ
user=> (clojure.string/replace "hello world" #"(hello) world" (fn (link: m) (println (str "Match: " m) m)))
Match: (link: "hello world" "hello") (link: hello world hello)
NullPointerException java.util.regex.Matcher.quoteReplacement (Matcher.java:655)