The Regex is:
pattern = new RegExp(/coordinates\([-+]?(\d+(\.\d+)?) [-+]?(\d+(\.\d+)?)\)/i)
Test:
pattern.exec('coordinates(1.5421245 23.243545689)')
results:
["coordinates(1.5421245 23.243545689)", "1.5421245", ".5421245", "23.243545689", ".243545689", index: 0, input: "coordinates(1.5421245 23.243545689)", groups: undefined]
and I can extract the points from index 1 and 3 as 1.5421245 and 23.243545689.
But for one or more negative numbers, it is not extracting the correct numbers.
Ex. pattern.exec('coordinates(1.5421245 -23.243545689)') returns
["coordinates(1.5421245 -23.243545689)", "1.5421245", ".5421245", "23.243545689", ".243545689", index: 0, input: "coordinates(1.5421245 -23.243545689)", groups: undefined]