title: Regex for validating only numbers and dots
body: <p>I want a java regex expression that accepts only the numbers and dots. </p>
  
  <p>for example, </p>
  
  <pre><code>             1.1.1 ----valid
               1.1   ----valid
               1.1.1.1---valid
               1.    ----not valid
  </code></pre>
  
  <p>The dots should not be at the starting position or at the ending position.</p>