title: Regex splitting strings on a character, not contained in ()
body: <p>I'm trying to split a string on a , where that character is not contained in ().</p>
  
  <p>Example String:</p>
  
  <pre><code>`table1`.`lname`,`table1`.`fname`,if(foo is not null,foo,if(bar is not null,bar,table3.baz)),`table3`.`shu`
  </code></pre>
  
  <p>I want to split it into an array looking like</p>
  
  <pre><code>(
    0=&gt;`table1`.`lname`
    1=&gt;`table1`.`fname`
    2=&gt;if(foo is not null,foo,if(bar is not null,bar,table3.baz))
    3=&gt;`table3`.`shu`
  )
  </code></pre>
  
  <p>Any ideas on how to tackle this problem?</p>
  
  <p>--
  Dave</p>