title: Regex - Remove all other texts except matching text
body: <p>I'm using sublime text 2 editor. I would like to remove all other texts except the name tag value.</p>
  
  <p>Here is an example</p>
  
  <pre><code>&lt;div class="control-group"&gt;
        &lt;label class="control-label" for="c_email"&gt;Email (required)&lt;/label&gt;
        &lt;div class="controls"&gt;
          &lt;input type="text" name="c_email" value=""&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>In the above code I would like to keep only the name tag value. To match all name tags I use regex like this</p>
  
  <pre><code>name="(.+?)"
  </code></pre>
  
  <p>It matches all name tags. But when I replace it with <code>$1</code> it only replaces <code>name="c_email"</code> with <code>c_email</code></p>
  
  <p>Can someone help me to erase all other texts?</p>
  
  <p>Thanks</p>