I need a regex that substitutes a string by looking at their commas.
For example the string:
str1 = "a,b,12,func(a,b),8,bob,func(1,2))"
should be transformed as following:
str1_transformed = "a;b;12;func(a,b);8;bob;func(1,2))"
I cannot substitute every "," with a ";" because it will look like:
str1_wrong = "a;b;12;func(a;b);8;bob;func(1;2))"
How can I deal with it?
I looked at the following threads without success:
How can I Split(',') a string while ignore commas in between quotes?
Regular Expression for Comma Based Splitting Ignoring Commas inside Quotes