I have a string which looks like this:
43.3433443 25.3434334), (43.32424432 25.435345345, 43.21313123, 25.32432423423), (43.123123123 25.344234234, 43.1234123123 25.23213123))
I need to extract everything that is between ( and ) as well as ( and )) with preg_match_all
I have the following regex, which works for extracting everything between ( and ) but not ( and ))
preg_match_all('/\), \(([A-Za-z0-9., ]+?)\)/', $data[$x], $inner);
I've tried using:
preg_match_all('/\), \(([A-Za-z0-9., ]+?)\)|\), \(([A-Za-z0-9., ]+?)\)\)/', $data[$x], $inner);
and:
preg_match_all('/(?=\), \(([A-Za-z0-9., ]+?)\))(?=\), \(([A-Za-z0-9., ]+?)\)\))/', $data[$x], $inner);
But none of them have worked. How would I go about to include both cases?
Thank you.
UPDATE:
I forgot to mention, the string contains numbers within multiple starting and ending parentheses that I don't want, i.e. two parantheses ---> (( numbers here ))) <---3 parantheses