title: Regex for parsing strings with quotes in OpenEdge data export
body: <p>I have a data export from a Progress OpenEdge system that I want to parse in JavaScript. I would like to find all the fields of the export using a regular expression.</p>
  
  <p>I have tried many things similar to this: <code>/("[^"]*")|[^\s]+/g</code> I have also tried to experiment with negative lookahead <code>(?!"")</code> but so far I have not succeeded.</p>
  
  <p>A sample export output might look something similar to this:</p>
  
  <pre><code>12345 24,25 0 2015-06-30T14:53:14.891 "12345" "24,25" "0" "2015-06-30T14:53:14.891" "" yes no ? "String with ""quoted"" word" "String 
  with a multi
  line string. "" &lt;- Just a quote
   " " This is the last value "
  6789 35,36 0 2016-07-31T15:54:15.892 "6789" "35,36" "0" "2016-07-31T15:54:15.892" "" no yes ? "Just a simple string" ? ?
  </code></pre>
  
  <p>The fields are: </p>
  
  <pre><code>DEFINE TEMP-TABLE tt_test NO-UNDO
      FIELD valueA AS INTEGER
      FIELD valueB AS DECIMAL
      FIELD valueC AS INTEGER
      FIELD valueD AS DATETIME
      FIELD valueE AS CHARACTER
      FIELD valueF AS CHARACTER
      FIELD valueG AS CHARACTER
      FIELD valueH AS CHARACTER
      FIELD valueI AS CHARACTER
      FIELD valueJ AS LOGICAL
      FIELD valueK AS LOGICAL
      FIELD valueL AS LOGICAL
      FIELD valueM AS CHARACTER
      FIELD valueN AS CHARACTER
      FIELD valueO AS CHARACTER
  .
  </code></pre>
  
  <p>The export format is:
  All fields are separated by a space. Strings are contained within double-quote characters ("). If there is a quote in the string that is escaped by using two double-quote characters (""). If there is an empty string that is also two double-quote characters ( "" ) but with delimiter spaces around them.</p>
  
  <p>The actual data types and the fact that this is a Progress system doesn't matter, it's just to give some context to my question.</p>
  
  <p><em>So to summarize:</em> How can I write a (JavaScript compatible) regular expression that successfully separates the different parts of the exported data while ignoring the escaped double-quotes in strings?</p>