title: jquery .replace(/./g, "") do not work for me but others
body: <p>I found this snippet somewhere and it works like a charm:</p>
  
  <pre><code>var n = parseInt(e.find("span.favNum").text().replace(/./g, "")) + 1;
  </code></pre>
  
  <p>If I do it in a similar way it doesn't work anymore.</p>
  
  <p>I do the following:</p>
  
  <pre><code>&lt;div id ="test"&gt;6.987&lt;/div&gt;
  var test = $("#test");
  var r = test.text().replace(/./g, "");
  console.log("wrong ", r);
  </code></pre>
  
  <p>I know that I can replace it also like this:</p>
  
  <pre><code>var r = test.text().replace(".", "");
  </code></pre>
  
  <p>This works.</p>
  
  <p>I would like to understand why the "stolen" snippet is working.
  Any idea?</p>
  
  <p><a href="http://jsfiddle.net/nJZMf/3/" rel="nofollow">http://jsfiddle.net/nJZMf/3/</a></p>
  
  <p>The original script is found here: <a href="http://wp-svbtle.themeskult.com/" rel="nofollow">http://wp-svbtle.themeskult.com/</a></p>
  
  <p>You will find the snippet by viewing the source of index.html and searching for <code>.replace</code>.</p>