Split by comma pattern matching
<p>What pattern can I use to split a string like this: </p>

<pre><code>f.id AS id, CONCAT(a1.id, a2.id, a3.id) AS cnp, SUM(A3.nr) AS sum
</code></pre>

<p>in such a way that the result is an array of 3 groups like this:</p>

<ol>
<li><code>f.id AS id</code></li>
<li><code>CONCAT(a1.id, a2.id, a3.id) AS cnp</code></li>
<li><code>SUM(A3.nr) AS sum</code></li>
</ol>

<p>Can I match a comma that is not enclosed by parentheses?</p>