Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bunch of (clojure) code that looks like this:

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

I want this code to become:

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

I tried:

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

For the search part, and:

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

For the replace part, but it found no matches. Am I doing something wrong?

share|improve this question
up vote 1 down vote accepted

Try (content (\(:[-a-z]+\) \([-a-z]+\))) instead.

share|improve this answer

Nevermind. My mistake. I was actually doing a non-regex replace when I thought I was doing a regex replace. Sorry for the mistake.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .