title: Regex matching spaces, but not in "strings"
body: <p>I am looking for a regular exression matching spaces only if thos spaces are not enclosed in double quotes ("). For example, in</p>
  
  <pre><code>Mary had "a little lamb"
  </code></pre>
  
  <p>it should match the first an the second space, but not the others.</p>
  
  <p>I want to split the string <strong>only</strong> at the spaces which are not in the double quotes, and not at the quotes.</p>
  
  <p>I am using C++ with the Qt toolkit and wanted to use QString::split(QRegExp). QString is very similar to std::string and QRegExp are basically POSIX regex encapsulated in a class. If there exist such a regex, the split would be trivial.</p>
  
  <p>Examples:</p>
  
  <pre><code>Mary had "a little lamb"     =&gt;   Mary,had,"a little lamb"
  1" 2 "3                      =&gt;   1" 2 "3 (no splitting at ")
  abc def="g h i" "j k" = 12   =&gt;   abc,def="g h i","j k",=,12
  </code></pre>
  
  <p>Sorry for the edits, I was very imprecise when I asked the question first. Hope it is somewhat more clear now.</p>