...">

Find and replace the word instance in vim

What I'm trying to do is find an instance of a piece of code, for example.

<textarea id="question1"> 

and replace it with a part of yourself:

 <textarea id="question1" name="question1"> 

How can I refer to "question1" in:% s vim?

+4
source share
1 answer
 :%s;<textarea id="\([^"]*\)">;<textarea id="\1" name="\1">; 
+4
source

All Articles