title: Regex that handles quoted strings and double quote for inches
body: <p>I am writing a little search for a website's product catalog, and I am using regex to determine if there are any strings like "exact search phrase" included in the text from the search text box. The regex that I am currently using is:</p>
  
  <pre><code>List&lt;string&gt; searchTermList = searchTerm.Trim().ToLower().Split(new Char[] { ' ' }).ToList();
  
  foreach (Match match in Regex.Matches(searchTerm, "\"([^\"]*)\""))
  {
  //irrelevant code
  }
  </code></pre>
  
  <p>This code works great for me until I search for something like:<br>
  <code>8" tortilla "stone ground"</code></p>
  
  <p>The result I would like as a match would be<br>
  <code>"stone ground"</code></p>
  
  <p>but instead I am getting<br>
  <code>" tortilla "</code>.</p>
  
  <p>The other posts I found for similar questions were escaping the double quote for inches, but I don't have any way to reliably escape quotes like those examples. The best option of the other articles I found was to escape it if it follows a number, but users could search for things like <code>"burger 3-1"</code> in quotes, which would be incorrect to escape the last quote in that case.</p>
  
  <p>What I would like is some way to tell if the string inside a set of quotes is preceded by a space or an empty string (if the only search text is a phrase in quotes), but I am inexperienced and struggling with regex, and I feel like it is my best option for tackling something like this. Any help/pointers?</p>