title: Swift - Regex - Extract numbers in brackets divided by comma(1,1)(2,3)
body: <p>I need to extract the numbers from a string  ex. &quot;(1,1)(3,3)(4,4)&quot;. I tried with &quot;\d(,)\d)&quot;, but I get the comma too. How can I exclude the comma and make e tuple or an array of arrays [[1,1],[3,3]...</p>
  <pre><code>let str = &quot;(1,1) (2,2) (3,3)&quot;
  let pattern = &quot;\\d(,)\\d&quot;
  let regex = try! NSRegularExpression(pattern:pattern)
  let results = regex.matches(in: str, options: [], range: range)
  </code></pre>