title: Capturing the first match with regex (C#)
body: <p>This is my first experience with C# and part of my limited experience with regular expressions and I'm having trouble capturing the first occurrence of a match in a particular expression. I believe the following example would make it more clear than words in describing what I want to do.</p>
  
  <pre><code>Match extractor = (new Regex(@".*\d(?&lt;name&gt;.*)\d.*")).Match("This hopefully will pick up 1Bob9error1 as a name");
          Console.WriteLine(extractor.Groups["name"]);
  </code></pre>
  
  <p>I would like to this expression to print "Bob" instead of "error".</p>
  
  <p>I have a hunch it has something to do with the ? in front of the matching group, but I'm not exactly sure what operation the ? performs in this particular case. An explanation along with some help would be wonderful.</p>
  
  <p>Thanks guys, you have no idea how much this site helps a beginning programmer like me.</p>