Emacs Regex Capture + Replace:(abc(:key map))->(abc(-> map:key str))


1

我有一堆看起来像这样的(clojure)代码:

(content (:some-key some-map))

我希望这段代码成为:

(content (-> some-map :some-key str))

我试过了:

(content (\(:[-a-z].*\) \([-a-z].*\)))

对于搜索部分,以及:

(content (-> \2 \1 str))

对于替换部分,但未找到匹配项。难道我做错了什么?

Answers:


1

试试吧(content (\(:[-a-z]+\) \([-a-z]+\)))


0

没关系。我的错。当我以为自己正在进行正则表达式替换时,实际上我在进行非正则表达式替换。对不起,这个错误。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.