title: regex to capture a number
body: <p>i have the following regex <code>(?x:-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)</code> which works for all number in</p>
  
  <pre><code>first -1.3 second 1.1e-2 third -1e-2 fourth -10 fith  -0.1 sixth .3 done.
  </code></pre>
  
  <p>but the last one <code>.3</code>.</p>
  
  <p>I was trying to make the first group <code>(?:0|[1-9]\\d*)</code> optional, but that breaks the regex. How can I make the regex working for all cases?</p>