I need to extract the numbers from a string ex. "(1,1)(3,3)(4,4)". I tried with "\d(,)\d)", 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]...
let str = "(1,1) (2,2) (3,3)"
let pattern = "\\d(,)\\d"
let regex = try! NSRegularExpression(pattern:pattern)
let results = regex.matches(in: str, options: [], range: range)