评论由: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)