title: Javascript Replace all commas not in double quotes
body: <p>I would like to replace all commas in a comma-delimited string with a pipe ('|') except for those that are found in double quotes.  I would prefer to use the JavaScript "replace" function if possible.</p>
  
  <p>My regex knowledge is limited at best.  I am able to replace all commas with pipes, but that does not give me the desired result for parsing through the data.  I also found a regex on here that removed all commas except those in quotations, but does not implement a pipe or some other delimiter.</p>
  
  <pre><code>(?!\B"[^"]*),(?![^"]*"\B)
  </code></pre>
  
  <p>Here is an example of what I'm trying to accomplish:</p>
  
  <pre><code>string1 = 1234,Cake,,"Smith,John",,"Status: Acknowledge,Accept",,Red,,
  </code></pre>
  
  <p>and I would like it to look like:</p>
  
  <pre><code>string1 = 1234|Cake||"Smith,John"||"Status: Ackknowledge,Accept"||Red||
  </code></pre>