title: Find numbers at a specific position
body: <p>I'm trying to find an expression for JavaScript which gives me the two characters at a specific position.</p>
  
  <p>It's always the same call so its may be not too complicated.</p>
  
  <p>I have always a 10 char long number and i want to replace the first two, the two at place 3 and 4 or the two at place 5 and 6 and so on.</p>
  
  <p>So far I've done this:</p>
  
  <pre><code>number.replace(/\d{2}/, index));
  </code></pre>
  
  <p>this replace my first 2 digits with 2 others digits.
  but now I want to include some variables at which position the digits should be replaced, something like:</p>
  
  <pre><code>number.replace(/\d{atposx,atpox+1}/, index));
  </code></pre>
  
  <p>that means:</p>
  
  <pre><code>01234567891
  </code></pre>
  
  <p>and I want sometimes to replace 01 with 02 and sometimes 23 with 56.</p>
  
  <p>(or something like this with other numbers).</p>
  
  <p>I hope I pointed out what I want.</p>