Q:

Perl - Split a string containing tuples using regex

I have a string containing tuples like below:
"(-0.345205479452055,1.3543),(-0.26027397260274,1.218),(-0.183561643835616,1.3028)"
I am trying to split this string to an array containing just the tuples: [(-0.345205479452055,1.3543),(-0.26027397260274,1.218),(-0.183561643835616,1.3028)]
I cannot use Split function like below since the function also splits up the tuple as well.  Is there a regex or some clever way to get the tuples as-is? 
@Tuples = split /,/,$myString;

A:

split can be used for this but requires a slightly more detailed expression. 
my @str = "(-0.345205479452055,1.3543),(-0.26027397260274,1.218),(-0.183561643835616,1.3028)");
my @arr1 = split(/(?<=\)),(?=\()/, $str);

The key here is the use of a zero-width look-behind assertion for checking for a closing paren and the use of a zero-width look-ahead assertion (not exactly necessary here but useful to see) to check for an open paren.  Check the perlre docs for more info on these. 
Alternatively, if you want to avoid split altogether then you can use a global match as well. 
my @arr2 = $str =~ /(\([^)]+\))/g;

