title: Remove square brackets in JSON data except between qoutes
body: <p>I am using the following code adapted from <a href="https://stackoverflow.com/a/8913186">this so answer</a></p>
  
  <pre><code>// remove outer bracket
  JSONdata = JSONdata.Trim().Trim('[', ']'); 
  
  // remove white space and line breaks except between double qoutes
  JSONdata = Regex.Replace(JSONdata.Trim('"').Replace("\\\"", "\""), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1"); 
  
  // add back bracket
  JSONdata = "[" + JSONdata + "]";
  </code></pre>
  
  <p>Then I get data like this:</p>
  
  <pre><code>[
   [
     {"OptionChoice":14151,"OptionText":"Television"},
     {"OptionChoice":14755,"OptionText":"Test[ something ]"}
   ]
   ,{"OptionChoice":361,"OptionText":"Yes"}
  ]
  </code></pre>
  
  <p>OR Minified (as it is in my real code)</p>
  
  <pre><code>[[{"OptionChoice":14151,"OptionText":"Television"},{"OptionChoice":14755,"OptionText":"Test[ something ]"}],{"OptionChoice":361,"OptionText":"Yes"}]
  </code></pre>
  
  <p><strong>Whitespace and line breaks added back for example only. Real data has no whitespace or line breaks</strong> </p>
  
  <p>I would like to be able to get keep the outer brackets but remove the set of inner brackets that is not in double quotes.</p>
  
  <p><strong>EDIT:</strong> Expected output </p>
  
  <pre><code>[
    {"OptionChoice":14151,"OptionText":"Television"},
    {"OptionChoice":14755,"OptionText":"Test[ something ]"},    
    {"OptionChoice":361,"OptionText":"Yes"}
  ]
  </code></pre>
  
  <p>Minified:</p>
  
  <pre><code>[{"OptionChoice":14151,"OptionText":"Television"},{"OptionChoice":14755,"OptionText":"Test[ something ]"},{"OptionChoice":361,"OptionText":"Yes"}]
  </code></pre>
  
  <p>I must confess that I don't fully understand the regexp that I have used. </p>
  
  <p>… and now I have two problems.</p>