title: Ruby regex multiple repeating captures
body: <p>I'm trying to parse a subset of a webpage with regex for just fun. It was fun till I encountered with the following problem. I have a paragraph like below;</p>
  
  <pre><code>foo: 1, 2, 3, 4 and 5.
  bar: 1, 2 and 3.
  </code></pre>
  
  <p>What I am trying to do is, get the numbers in the first line of the paragraph starting with <code>foo:</code> by applying following regex:</p>
  
  <pre><code>foo:(?:\s(\d)(?:,|\sand|\.))+
  </code></pre>
  
  <p>This matches with the above string but it captures only the last occurrence of the capture group which is <code>5</code>.</p>
  
  <p>How can I capture all the numbers in a paragraph starting with <code>foo:</code> till the first occurrence of <code>.</code> using single regex pattern.</p>