title: Regex to extract a font family list from a CSS font declaration
body: <p>I am trying to create a .NET Regex to parse a CSS font declaration, which takes following form:</p>
  
  <pre><code>font: italic small-caps bold xx-small 3.0em "Times New Roman", Times, serif;
  </code></pre>
  
  <p>According to the CSS specification, all of the elements of the declared value are optional, and I have successfully created Regexes that match the first five elements (in all their different permitted forms), but I am having trouble creating a Regex that matches the list of font names, which is always the last element in the property value. I don't need to identify the individual elements in the font names list; I just want to match the list as a whole.</p>
  
  <p>The font names list is comma separated list (with optional whitespace between elements) and each member of the list is either a single-word name or multiple words enclosed in quotes.</p>
  
  <p>So far, I have come up with the following expression ...</p>
  
  <pre><code>(?&lt;NAME_LIST&gt;(?&lt;QUOTED_NAME&gt;"[\w ]+")|(?&lt;SIMPLE_NAME&gt;\w+)(?:,\s*(?&lt;QUOTED_NAME&gt;"\w ]+")|(?&lt;SIMPLE_NAME&gt;\w+))*)
  </code></pre>
  
  <p>... but it matches each member of the list individually, instead of matching the entire list.</p>
  
  <p>Any ideas would be appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Tim</p>