Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.