title: Javascript Regex For only numbers and no white spaces
body: <p>I was very surprised that I didn't find this already on the internet.
  is there's a regular expression that validates only digits in a string including those starting with 0 and not white spaces</p>
  
  <p>here's the example I'm using</p>
  
  <pre><code>  function ValidateNumber() {
  
    var regExp = new RegExp("/^\d+$/");
    var strNumber = "010099914934";
    var isValid = regExp.test(strNumber);
    return isValid;
  }
  </code></pre>
  
  <p>but still the isValid value is set to false</p>