title: Replace leading 0 with regex
body: <p>I am trying to stop the user being able to enter a 0 as the first number.</p>
  
  <p>This is the code I have atm</p>
  
  <pre><code>function validate_numberonly(evt)
  {
      var theEvent = evt || window.event;
      var key = theEvent.keyCode || theEvent.which;
      key = String.fromCharCode( key );
      var regex = /[0-9]|\./;
      if( !regex.test(key) ) {
          theEvent.returnValue = false;
          theEvent.preventDefault();
      } 
  }
  </code></pre>
  
  <p>The regex to allow this is <code>replace(/[^0-9]/g,'');</code> But entering this instead of the current regex doesn't seem to work</p>