0

I have a text like :value_subvalue that I want to transform to :value[:subvalue].

I have a find & replace field in Coda where I can enter a regex to find and replace.

Any idea how to do this?

2
  • Can you post a big piece of text that imitates the text that you want to work on? Otherwise, the regex may not work for you. Commented Jul 25, 2012 at 4:34
  • 1
    @Bohemian: I'm guessing PCRE (or subset of it). From my search Coda is a text editor. Commented Jul 25, 2012 at 4:35

1 Answer 1

3

You haven't said what language, so this is a generic answer:

  • Search regex: (:[a-z]+)_([a-z]+)
  • Replacement: \1[:\2]

If you're doing this in java, the group refs would be $1 and $2

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.