title: Javascript reg ex need integer between 1 and 999999?
body: <p>I wish I could solve this by myself, but I have never quite grasped regular expressions.  They seem so powerful.  I wanted to ask where is the best resource to learn javascript reg ex, but that was to subjective and I didn't want my question closed.  I have a textbox on a web form, when it has a value, that value should be an integer between 1 &amp; 999999.  I already use the jquery numeric plug in to only allow digits, all other keystrokes are rejected, there is an onBlur implementation, that if some regex is not matched, a callback will be called... This is that code...</p>
  
  <pre><code>$.fn.numeric.blur = function()
  {
  var decimal = $.data(this, "numeric.decimal");
  var callback = $.data(this, "numeric.callback");
  var val = $(this).val();
  if(val != "")
  {
      var re = new RegExp("^\\d+$|\\d*" + decimal + "\\d+");
      if(!re.exec(val))
      {
          callback.apply(this);
      }
  }
  }
  </code></pre>
  
  <p>Can I modify that regex to assure the val is a valid integer between 1 and 999999?  Any help would be appreciated.  Also obviously I would like to do this by myself, whats an easy way to learn javascript regex?  Thank you all so much.  Have a terrific holiday all!</p>
  
  <p>Cheers,<br>
  ~ck in San Diego</p>