title: Get repeating regex groups in scala
body: <p>I'm working on a Scala app, and trying to parse a file using Regex.
  The file format is something like this:</p>
  
  <pre><code>actions{
  ACTION_NAME=[ELEMENT,ANOTHER_ELEMENT,SOMETHING_ELSE]
  ANOTHER_ACTION=[SOMETHING_HERE,ANOTHER_ONE]
  }
  </code></pre>
  
  <p>where the amount of elements within the curly brackets is dynamic.</p>
  
  <p>I would like to iteratively match those rows to  tuples, (e.g.  ACTION_NAME | ELEMENT,ANOTHER_ELEMENT,SOMETHING_ELSE ) so
  I matched it using the following Regex:</p>
  
  <pre><code>actions\{(?:[\s\n]*([A-Z_]+)=\[([A-Z_,]*)\][\s\n]*)*\}
  </code></pre>
  
  <p>The match works fine, but my matcher groups, include only the last key &amp; value of course. How can I make the matcher to iterate over the repetitions and return all of the matches in the file as a key,value,key,value,key,value iterator...</p>
  
  <p>Thanks</p>