title: Removing commas from formula using regex
body: <p>I'm trying to format numbers in Javascript using regex where the numbers are part of a formula. For example, given <code>12345.6789+9876.54321*-100</code> the result should be <code>12,345.6789+9,876.54321*-100</code>. </p>
  
  <p>This is my attempt:</p>
  
  <p><code>str.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")</code></p>
  
  <p>and the result:</p>
  
  <p><code>12345.6,789+9876.54,321*-100</code></p>
  
  <p>It inserts commas in decimal places (<a href="http://plnkr.co/edit/pIzyqy3N1mU8QAVp2bla?p=preview" rel="nofollow noreferrer">PLUNK</a>), how to fix this?</p>