title: Regexp to capture comma separated values
body: <p>I have a string that can be a comma separated list of <code>\w</code>, such as:</p>
  
  <ul>
  <li>abc123</li>
  <li>abc123,def456,ghi789</li>
  </ul>
  
  <p>I am trying to find a JavaScript regexp that will return <code>['abc123']</code> (first case) or <code>['abc123', 'def456', 'ghi789']</code> (without the comma).</p>
  
  <p>I tried:</p>
  
  <ul>
  <li><code>^(\w+,?)+$</code> -- Nope, as only the last repeating pattern will be matched, 789</li>
  <li><code>^(?:(\w+),?)+$</code> -- Same story. I am using non-capturing bracket. However, the capturing just doesn't seem to happen for the repeated word</li>
  </ul>
  
  <p>Is what I am trying to do even possible with regexp? I tried pretty much every combination of grouping, using capturing and non-capturing brackets, and still not managed to get this happening...</p>