title: Match all consecutive numbers of length n
body: <p>Where n=4 in my example.</p>
  
  <p>I'm very new to Regex and have searched for 20 minutes now. There are some helpful websites out there that simplify things but I can't work out how to proceed with this.</p>
  
  <p>I wish to extract every combination of 4 consecutive digits from this:</p>
  
  <pre><code>12345
  </code></pre>
  
  <p>to get:</p>
  
  <pre><code>1234 - possible with ^\d{4}/g  - Starts at the beginning
  2345 - possible with  \d{4}$/g - Starts at the end
  </code></pre>
  
  <p>But I can't get both! The input could be any length.</p>