title: Java Regex in round brackets
body: <p>I am trying to parse an input string like this</p>
  
  <pre><code>String input = "((1,2,3),(3,4,5),(2,3,4),...)"
  </code></pre>
  
  <p>with the aim of getting an array of String where each element is an inner set of integers i.e.  </p>
  
  <pre><code>array[0] = (1,2,3)
  array[1] = (3,4,5)
  </code></pre>
  
  <p>etc.</p>
  
  <p>To this end I am first of all getting the inner sequence with this regex:</p>
  
  <pre><code>String inner = input.replaceAll("\\((.*)\\)","$1");
  </code></pre>
  
  <p>and it works. Now I'd like to get the sets and I am trying this</p>
  
  <pre><code>String sets = inner.replaceAll("((\\((.*)\\),?)+","$1")
  </code></pre>
  
  <p>But I can't get the result I expected. What am I doing wrong?</p>