How can I split text on commas not within double quotes, while keeping the quotes?
<p>So I'm trying to split a string in javacript, something that looks like this:</p>

<pre><code>"foo","super,foo"
</code></pre>

<p>Now, if I use <code>.split(",")</code> it will turn the string into an array containing <code>[0]"foo" [1]"super [2]foo"</code>
however, I only want to split a comma that is between quotes, and if I use <code>.split('","')</code>, it will turn into <code>[0]"foo [1]super,foo"</code></p>

<p>Is there a way I can split an element expressing delimiters, but have it keep certain delimiters WITHOUT having to write code to concatenate a value back onto the string? </p>

<p>EDIT:</p>

<p>I'm looking to get <code>[0]"foo",[1]"super,foo"</code> as my result. Essentially, the way I need to edit certain data, I need what is in [0] to never get changed, but the contents of [1] will get changed depending on what it contains. It will get concatenated back to look like <code>"foo", "I WAS CHANGED"</code> or it will indeed stay the same if the contents of [1] where not something that required a change</p>
