title: JavaScript regular expression check number only
body: <p>I want a regular expression for the following values:</p>
  
  <pre><code>1) .1 = False.
  2) 0.1 = True.
  3) 1.1245 = True.
  4) 1.2. = False.
  5) 1.24.35 = False.
  6) 21.152 = true.
  </code></pre>
  
  <p>This regex should check that the string represents an integer or is composed of only numbers and a single <code>.</code> representing a decimal point.</p>
  
  <p>I am using: <code>/^[\+\-]?\d*\.?\d+(?:[Ee][\+\-]?\d+)?$/</code> but it takes <code>"1.2."</code> as <code>true</code>.</p>