title: C# - Regular Expression to split string on spaces, unless a double quote is encountered
body: <p>This thread is very similar to what I want: <a href="https://stackoverflow.com/questions/554013/regular-expression-to-split-on-spaces-unless-in-quotes">Regular Expression to split on spaces unless in quotes</a></p>
  
  <p>But I need a few extra rules that I cannot figure out:
  - the above thread does split on spaces, unless they're in double quotes. However, it splits on punctuation as well.  I need Anything inside the double quotes to remain as one entity.</p>
  
  <p>For example:<br>
  <strong>/Update setting0 value="new value" /Save</strong>  should return<br>
  /Update<br>
  setting0<br>
  value=<br>
  new value <em>(I don't care whether it trims the quotes off or not)</em><br>
  /Save</p>
  
  <p><strong>/Import "C:\path\file.xml" "C:\path_2\file_2.xml" /Exit</strong> should return<br>
  /Import<br>
  C:\path\file.xml <em>(I don't care whether it trims the quotes off or not)</em><br>
  C:\path_2\file_2.xml<br>
  /Exit</p>
  
  <p>I ended up using this expression from the thread above: </p>
  
  <pre><code>(?&lt;=")\w[\w\s]*(?=")|\w+|"[\w\s]*"
  </code></pre>
  
  <p>Could someone please help me tweak it?  Thanks!</p>