title: Different regex behaviour in web page and Chrome extension
body: <p>I am trying out this regex on this page:
  <a href="http://www.regular-expressions.info/javascriptexample.html" rel="nofollow">http://www.regular-expressions.info/javascriptexample.html</a></p>
  
  <p>where Regex=<code>(?:http:\/\/)?(?:www.)?facebook\.com\/([\w\-\.]*)?</code></p>
  
  <p>and Subject String = <code>http://www.facebook.com/xxxxxx</code></p>
  
  <p>This returns me two matches: <code>http://www.facebook.com/xxxxxx</code> and <code>xxxxxx</code></p>
  
  <p>The same javascript I have embedded in my chrome extension, however there it shows me only one match: 'http://www.facebook.com/' . Any ideas ? Following is the code:</p>
  
  <pre><code>var re = new RegExp("(?:http:\/\/)?(?:www.)?facebook\.com\/(?:profile\.php\?id=(?=\d.*))?([\w\-]*)?");
    var m = re.exec("http://www.facebook.com/xxxxx");
    if (m == null) {
      alert("No match");
    } else {
      var s = "Match at position " + m.index + ":\n";
      for (i = 0; i &lt; m.length; i++) {
        s = s + m[i] + "\n";
      }
      alert(s);
    }
  </code></pre>