title: Getting contents within ( ) and using that later
body: <p>I have a code so far with regex to replace the content that shouldn't be there   EX:</p>
  
  <pre><code>var a = $('.uTubeE').attr('href').replace(/\(((\s*?.*?)*?)\)/g,'');
          $('.uTubeE').attr('href',a).text(a).attr('title',$1);
  </code></pre>
  
  <p>Text to remove from looks like this:</p>
  
  <pre><code>&lt;a href="www.url.com(content)"&gt;www.url.com(content)&lt;/a&gt;
  </code></pre>
  
  <p>As you can see I am trying to use the content I remove as the title attribute now, I know the var a is wrong since I am replacing the content. I'm not sure how to grab it though because once I do that I can then simply do this-</p>
  
  <pre><code>  var correct= $('.uTubeE').attr('href').replace($1);
    $('.uTubeE').attr({
       href: correct,
       title: $1
       }).text(correct);
  </code></pre>
  
  <p>just not sure how to do it all correctly.</p>
  
  <p>Any suggestions and help with using the regex?</p>
  
  <p>New Issue states there is 0 of undefined></p>
  
  <pre><code>var a = $(forum[yourVersion]+' a[href*="watch?v"]');
    for (i = 0; i &lt; a.length; i++) {
       var xyx = a[i].href.match(/\(((\s*?.*?)*?)\)/);
       var b = a[i].href.replace(new RegExp("watch\\?v=", "i"), 'v/');
       a[i].href= b;
       var cc = b.replace(/(www\.)?youtube.com/, 'img.youtube.com');
       var dd = cc.replace('v','vi').replace(xyx[0],'');
       a[i].outerHTML= '&lt;a class="uTubeE" rel="vid_gallery" title="'+xyx[1]+'" href="' + b + '"&gt;&lt;span class="uTubeE_overlay"&gt;&lt;/span&gt;&lt;img src="'+ dd +'/0.jpg"/&gt;&lt;/a&gt;';
       }
  </code></pre>