title: Match comma separated list with Ruby Regex
body: <p>Given the following string, I'd like to match the elements of the list and parts of the rest after the colon:</p>
  
  <blockquote>
    <p>foo,bar,baz:something</p>
  </blockquote>
  
  <p>I.e. I am expecting the first three match groups to be "foo", "bar", "baz". No commas and no colon. The minimum number of elements is 1, and there can be arbitrarily many. Assume no whitespace and lower case.</p>
  
  <p>I've tried this, which should work, but doesn't populate all the match groups for some reason:</p>
  
  <p><code>^([a-z]+)(?:,([a-z]+))*:(something)</code></p>
  
  <p>That matches foo in \1 and baz (or whatever the last element is) in \2. I don't understand why I don't get a match group for bar.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT: Ruby 1.9.3, if that matters.</p>
  
  <p>EDIT2: Rubular link: <a href="http://rubular.com/r/pDhByoarbA" rel="nofollow">http://rubular.com/r/pDhByoarbA</a></p>
  
  <p>EDIT3: Add colon to the end, because I am not just trying to match the list. Sorry, oversimplified the problem.</p>