title: Understanding a basic Javascript regular expression
body: <p>In Javascript ,why</p>
  
  <pre><code>/^(\d{1}){3}$/.exec(123)
  </code></pre>
  
  <p>returns <code>["123", "3"]</code>, but</p>
  
  <pre><code>/^(\d{1})$/.exec(123)
  </code></pre>
  
  <p>returns <code>null</code> rather than <code>["3"]</code>.</p>
  
  <p>Also, why is the first expression returning <code>3</code>, when <code>1</code> is the digit that follows <code>^</code> ?</p>