title: Best way to remove thousand separators from string amount using a regex
body: <p>I have variables that contain amounts and would like to remove the (US) thousand separators but also have to cover the scenario that there may be non-US formatted amounts where the comma is used for the decimals instead of for the thousands where I don't want to replace the comma. </p>
  
  <p><strong>Examples:</strong>  </p>
  
  <ul>
  <li>1,234,567.00 needs to become 1234567.00</li>
  <li>1,234.00 needs to become 1234.00<br>
  but</li>
  <li>1.234.567,00 needs to remain unchanged as not US format (i.e. comma here is used for decimals)</li>
  <li>1.234,00 needs to remain unchanged as not US format (i.e. comma here is used for decimals)</li>
  </ul>
  
  <p>I was thinking of using the following but wasn't sure about it as I am pretty new to Regex:  </p>
  
  <pre><code>myVar.replace(/(\d+),(?=\d{3}(\D|$))/g, "$1");
  </code></pre>
  
  <p>What is best solution here? Note: I just need to cover normal amounts like the above examples, no special cases like letter / number combinations or things like 1,2,3 etc. </p>