title: Regex: How to get a group name
body: <p>I have a .NET Regex which looks similar to:</p>
  
  <pre><code>(?&lt;Type1&gt;AAA)|(?&lt;Type2&gt;BBB)
  </code></pre>
  
  <p>I'm using the <em>Matches</em> method against a sample string e.g. <code>"AAABBBAAA"</code>, and then iterating over the matches.</p>
  
  <p>My goal is to find the match types, using the regex match group, so for this regex it will be:</p>
  
  <ul>
  <li>Type1</li>
  <li>Type2</li>
  <li>Type1</li>
  </ul>
  
  <p>I couldn't find any <code>GetGroupName</code> method. Please help.</p>