title: Javascript regex URL matching
body: <p>I have this so far:</p>
  <pre><code>chrome.tabs.getSelected(null, function(tab) 
  {
      var title = tab.title;
      var btn = '&lt;a href=&quot;' + tab.url + '&quot; onclick=&quot;save(\'' + title + '\');&quot;&gt; ' + title + '&lt;/a&gt;';
          
      if(tab.url.match('/http:\/\/www.example.com\/version.php/i')) 
      {
          document.getElementById('link').innerHTML = '&lt;p&gt;' + btn + '&lt;/p&gt;';
      }
  });
  </code></pre>
  <p>Basically it should match the domain within this:</p>
  <pre><code>http://www.example.com/version.php?*
  </code></pre>
  <p>Anything that matches that even when it includes something like version.php?ver=1, etc</p>
  <p>When I used the code above of mine, it doesn't display anything, but when I remove the if statement, it's fine but it shows on other pages which it shouldn't <strong>only</strong> on the matched URL.</p>
  <p><strong>EDIT:</strong></p>
  <pre><code>if(tab.url.match(/http:\/\/www.example.com\/version.php/i)) 
  {
      document.getElementById('link').innerHTML = '&lt;p&gt;' + btn + '&lt;/p&gt;';
  }
  </code></pre>
  <p>Doesn't even work somehow...</p>