title: How do I get the name of captured groups in a C# Regex?
body: <p>Is there a way to get the name of a captured group in C#?</p>
  
  <pre><code>string line = "No.123456789  04/09/2009  999";
  Regex regex = new Regex(@"(?&lt;number&gt;[\d]{9})  (?&lt;date&gt;[\d]{2}/[\d]{2}/[\d]{4})  (?&lt;code&gt;.*)");
  
  GroupCollection groups = regex.Match(line).Groups;
  
  foreach (Group group in groups)
  {
      Console.WriteLine("Group: {0}, Value: {1}", ???, group.Value);
  }
  </code></pre>
  
  <p>I want to get this result:</p>
  
  <pre>
  Group: [I don´t know what should go here], Value: 123456789  04/09/2009  999
  Group: number, Value: 123456789
  Group: date,   Value: 04/09/2009
  Group: code,   Value: 999
  </pre>