title: What is the C# equivalent of java.util.regex?
body: <p>I am converting Java code to C# and need to replace the use of Java's regex. A typical use is</p>
  
  <pre><code>import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  //...
  
  String myString = "B12";
  Pattern pattern = Pattern.compile("[A-Za-z](\\d+)");
  Matcher matcher = Pattern.matcher(myString);
  String serial = (matcher.matches()) ? matcher.group(1) : null;
  </code></pre>
  
  <p>which should extract a capture group from a matched target string. I'd be grateful for simple examples.</p>
  
  <hr/>
  
  <p><strong>EDIT</strong>: I have now added the C# equivalent of the code as an answer.</p>
  
  <p><strong>EDIT</strong>: <a href="http://geekswithblogs.net/shahed/archive/2005/10/10/56498.aspx" rel="noreferrer">Here is a tutorial</a> on the use of the actual expressions.</p>
  
  <p><strong>EDIT</strong>: <a href="http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=523" rel="noreferrer">Here is a useful comparison</a> of C# and Java (and Perl.)</p>