title: Splitting values by commas that are outside parentheses?
body: <p>I have the following string:</p>
  
  <pre><code>[A] == [B] * 10 - FUNCTION([C], STRING_EXPRESSION, FUNCTION([D],[C],[E])), FUNCTION([C], [X]), 100
  </code></pre>
  
  <p>and want to split it by commas that are outside parentheses to this:</p>
  
  <ul>
  <li><code>[A] == [B] * 10 - FUNCTION([C], STRING_EXPRESSION, FUNCTION([D],[C],[E]))</code></li>
  <li><code>FUNCTION([C], [X])</code></li>
  <li><code>100</code></li>
  </ul>
  
  <p>I was not able to do this alone or using any of the similar answers here.</p>
  
  <p>For example, <a href="https://stackoverflow.com/questions/26633452/how-to-split-by-commas-that-are-not-within-parentheses"><code>,\s*(?!\[^()\]*\))</code></a> regular expression works well, but only if not nested parentheses are used, which is my case.</p>
  
  <p>Could anyone tell me how to split the values (using or not regular expression)?</p>