title: How to check a string contains only digits and decimal points?
body: <p>For example I want to check that my when I split my string that the first part only contains numbers and decimal points. </p>
  
  <p>I have done the following </p>
  
  <pre><code>String[] s1 = {"0.12.13.14-00000001-00000", "0.12.13.14-00000002-00000"};
  
          String[] parts_s1 = s1.split("-");
          System.out.println(parts_s1[0]);
          if(parts_s1[0].matches("[0-9]")
  </code></pre>
  
  <p>But thats only checking for numbers and not decimals. How can I also check for decimals in this? For example I want to check for 0.12.13.14 that it works and something like 0.12.13.14x will not work. </p>