title: Capturing all subgroups
body: <p>How I can capture all repeating groups?</p>
  
  <p>I wanted to have one single match for all letters separated by dash. I was expecting to see 3 groups and in each of them a letter. What is happening? Can I get all the groups?</p>
  
  <pre><code>val matcher = java.util.regex.Pattern.compile("(?:(\\w)-?)+").matcher("a-b-c")
  matcher.matches()
  println(matcher.groupCount())
  println(matcher.group(0))
  println(matcher.group(1))
  </code></pre>
  
  <p>This prints</p>
  
  <pre><code>1
  a-b-c
  c
  </code></pre>
  
  <p>I was expecting to get something like</p>
  
  <pre><code>3
  a-b-c
  a
  </code></pre>