How to split string while ignoring portion in parentheses?
<p>I have a string that I want to split into an array by using the commas as delimiters.  I do not want the portions of the string that is between parentheses to be split though even if they contain commas.</p>

<p>For example: </p>

<pre><code>"bibendum, morbi, non, quam (nec, dui, luctus), rutrum, nulla" 
</code></pre>

<p>Should become:</p>

<pre><code>["bibendum", "morbi", "non", "quam (nec, dui, luctus)", "rutrum", "nulla"]
</code></pre>

<p>But when I use a basic <code>.split(",")</code>, it returns:</p>

<pre><code>["bibendum", " morbi", " non", " quam (nec", " dui", " luctus)", " rutrum", " nulla"]
</code></pre>

<p>I need it to return:</p>

<pre><code>["bibendum", " morbi", " non", " quam (nec, dui, luctus)", " rutrum", " nulla"]
</code></pre>

<p>Your help is appreciated.</p>