title: Java get integer value from string
body: <p>I'd like to get the integer value from my string. Below is my example.</p>
  
  <pre><code>String strScore = "Your score is 10. Probability in the next 2 years is 40%";
  </code></pre>
  
  <p>But I just want to get the score which is 10. How can I do this?</p>
  
  <p>UPDATED:</p>
  
  <pre><code>String firstNumber = strScore.replaceFirst(".*?(\\d+).*", "$1");
  
  bfLog.createEntry( firstNumber );
  </code></pre>
  
  <p>I save this to sqlite database.</p>