title: Java: splitting a comma-separated string but ignoring commas in quotes
body: <p>I have a string vaguely like this:</p>
  <pre><code>foo,bar,c;qual=&quot;baz,blurb&quot;,d;junk=&quot;quux,syzygy&quot;
  </code></pre>
  <p>that I want to split by commas -- but I need to ignore commas in quotes. How can I do this? Seems like a regexp approach fails; I suppose I can manually scan and enter a different mode when I see a quote, but it would be nice to use preexisting libraries. (<em>edit</em>: I guess I meant libraries that are already part of the JDK or already part of a commonly-used libraries like Apache Commons.)</p>
  <p>the above string should split into:</p>
  <pre><code>foo
  bar
  c;qual=&quot;baz,blurb&quot;
  d;junk=&quot;quux,syzygy&quot;
  </code></pre>
  <p><strong>note:</strong> this is NOT a CSV file, it's a single string contained in a file with a larger overall structure</p>