title: Regex to check whether a string contains only numbers
body: <pre><code>hash = window.location.hash.substr(1);
  var reg = new RegExp('^[0-9]$');
  console.log(reg.test(hash));
  </code></pre>
  
  <p>I get false on both <code>"123"</code> and <code>"123f"</code>. I would like to check if the hash only contains numbers. Did I miss something?</p>