How does the replace method match all commas between parentheses?

how do I match all the commas between parentheses?
there is only one parenthesis.
the bosses used a favor in the development

.


1:

var str="jskd,123(123,123,123,lskdf,ksldfj,sldfk,),123,lsdkj";
var regex=/,(?=[^(]*\))/g;
str.replace(regex,"");

solution 2 [solve the doubts raised by netizens]:

var str="jskd,123(123,123,123,lskdf,ksldfj,sldfk,),123,lsdkj";
str.replace(/\([^()]+\)/g,function(matchStr){
    return matchStr.replace(/,/g,"");
});
Menu