title: Remove decimal points and commas using regex in python
body: <p>I have the following string:</p>
  
  <pre><code>st='19.000\n20,000'
  </code></pre>
  
  <p>i want to remove the commas and points <strong>ONLY FOR NUMBERS</strong>. I am using the following code</p>
  
  <pre><code>re.sub(r'[^\d\.]','',st)
  </code></pre>
  
  <p>The result is:</p>
  
  <blockquote>
    <p>'19.00020000'</p>
  </blockquote>
  
  <p>I am newbie in regex. How do I preserve the new line and remove the dot Can anyone help?</p>