title: How to get repeating groups with regex?
body: <p>I have this string for instance:</p>
  <pre><code>Something`3[[typeOne],[typeTwo],[typeThree]][[typeOne],[typeTwo],[typeThree]]
  </code></pre>
  <p>Which can contain N types:</p>
  <pre><code>[[type1],...,[typeN]]
  </code></pre>
  <p>I want to extract these internal <code>typeX</code> strings (<code>type1</code>, ... , <code>typeN</code>). I use this pattern (ignore whitespaces - it's just for readability):</p>
  <pre><code>\[
     (?:,?\[
        ([^\]]*)
     \])+
  \]
  </code></pre>
  <p>But it gives me only the last type (<code>typeN</code>). How can I get all the <code>typeX</code> strings using regex?</p>
  <h1>Edit:</h1>
  <p>Actually, the real problem is</p>
  <pre><code>Something`3[[typeOne],[typeTwo],[typeThree]]
  </code></pre>
  <p>Which can contain N types:</p>
  <pre><code>Something`N[[type1],...,[typeN]]
  </code></pre>
  <p>And my regex is:</p>
  <pre><code>(?:`(?&lt;count&gt;\d+)\[
     (?:,?\[([^]]+)\])+
  \])
  </code></pre>
  <p>Sorry for changing the question in the middle, I tried to simplify the input for the question, and <a href="https://stackoverflow.com/a/26233622/587467">some solution below (Avinash Raj)</a> does solve the prior input, but not this one...</p>
  <h1>Edit 2:</h1>
  <p>I seemed to overly simplified my question, for the sake of readability... this is my actual and full requirement:</p>
  <p><a href="https://stackoverflow.com/questions/26234495/how-to-get-repeating-groups-that-nest-within-another-group-with-regex">How to get repeating groups that nest within another group with regex?</a></p>