title: Extract some atribute values with regex wether other atributes are present or not
body: <p>I'am having hard times trying to get my values with regex in an XML like line</p>
  
  <pre><code>&lt;themes:MetaGrid x:Key="external_liquid_waste" x:Shared="False" Categories="LiquidsAndWastes,Others" Group="XD"&gt;
  </code></pre>
  
  <p>I'm trying to retreive only the values of <code>key</code> and <code>categories</code> attributes wether the <code>Group</code> or the <code>x:Shared</code> attributes are present or not.</p>
  
  <p>The separators in the category attribute can be either a coma, a semicolon or a whitespace.</p>
  
  <p>So far (before adding the Group attribute) I was using this expression : </p>
  
  <pre><code>&lt;.+MetaGrid.+x:Key="(?&lt;reskey&gt;[\w]+)".+Categories="(?&lt;resca&gt;.+)".+&gt;
  </code></pre>
  
  <p>But with the group attriute, the second capture returns <code>LiquidsAndWastes" Group=</code> which is not good.</p>
  
  <p>Any pointers would be much appreciated.</p>
  
  <p>Thanks !!</p>