title: c# Regex for list Parsing
body: <p>I have a text field that accepts user input in the form of delimeted lists of strings.  I have two main delimeters, a space and a comma.</p>
  
  <p>If an item in the list contains more than one word, a user can deliniate it by enclosing it in quotes.</p>
  
  <p>Sample Input:</p>
  
  <pre><code>Apple, Banana Cat, "Dog starts with a D" Elephant Fox "G is tough", "House"
  </code></pre>
  
  <p>Desired Output:</p>
  
  <pre><code>Apple
  Banana
  Cat
  Dog starts with a D
  Elephant
  Fox
  G is a tough one
  House
  </code></pre>
  
  <p>I've been working on getting a regex for this, and I can't figure out how to allow the commas.  Here is what I have so far:</p>
  
  <pre><code> Regex.Matches(input, @"(?&lt;match&gt;\w+)|\""(?&lt;match&gt;[\w\s]*)""")
               .Cast&lt;Match&gt;()
               .Select(m =&gt; m.Groups["match"].Value.Replace("\"", ""))
               .Where(x =&gt; x != "")
               .Distinct()
               .ToList()
  </code></pre>