title: Regular expression for any double type number
body: <p>I am trying to do the following:</p>
  
  <pre><code>myVar = q.match(/[0-9]*\.[0-9]+|[0-9]+/);
  </code></pre>
  
  <p>However, when I type a decimal, myVar doesn't pick up the decimal until after I type decimal values. </p>
  
  <pre><code>Entered 3, myVar = 3
  Entered ., myVar = 3
  Entered 3, myVar 3.3
  </code></pre>
  
  <p>How do I modify this so myVar would equal 3. at the second step?</p>
  
  <p>Thanks.</p>