title: how to extract numeric values from input string in java
body: <p>How can I extract only the numeric values from the input string?</p>
  
  <p>For example, the input string may be like this:</p>
  
  <pre><code>String str="abc d 1234567890pqr 54897";
  </code></pre>
  
  <p>I want the numeric values only i.e, <code>"1234567890"</code> and <code>"54897"</code>. All the alphabetic and special characters will be discarded.</p>