Replace while keeping certain "words" in vi/vim

Viewed 3744

For example, if I have $asd['word_123'] and I wanted to replace it with $this->line('word_123'), keeping the 'word_123'. How could I do that?

By using this:

%s/asd\[\'.*\'\]/this->line('.*')/g

I will not be able to keep the wording in between. Please enlighten me.

2 Answers
Related