title: Grouping Regular expression BackReferences
body: <p>I have the following RegEx</p>
  
  <pre><code>id=(.*?) | id="(.*?)"
  </code></pre>
  
  <p>The reason for this is I am trying to replace Ids from the browsers DOM using JavaScript. IE, however strips quotes from element atributes as it appears not to require them in the DOM</p>
  
  <p>The problem I have is that the backrefererences from each alternate statement are in separate groups ($1 and $2)  as the match is only one OR the other can I return both the backreference as a single backreference?</p>
  
  <p>EDIT:</p>
  
  <pre><code>&lt;div id="test1" /&gt;&lt;div id=test2 /&gt;
  </code></pre>
  
  <p>will match as follows</p>
  
  <pre><code>    match         |  $1   |   $2
  --------------------------------
      id="test1"    | test1 |
      id=test2      |       |  test2
  </code></pre>
  
  <p>I just want both backreferences to be added to $1</p>