title: Java support for  "(?<name>pattern)" in patterns
body: <p>I was wondering if Java had an equivalent to C#’s named pattern matching.  For example, in C# I can do something like this:</p>
  
  <pre><code>var pattern = @";(?&lt;foo&gt;\d{6});(?&lt;bar&gt;\d{6});";
  var regex = new Regex(pattern , RegexOptions.None);
  var match = regex.Match(";123456;123456;");
  
  var foo = match.Groups["foo"].Success ? match.Groups["foo"].Value : null;
  var bar = match.Groups["bar"].Success ? match.Groups["bar"].Value : null;
  </code></pre>
  
  <p>This just seems like a clean way to grab groups.  Can Java do something similar, or do I need to grab groups based on index position?</p>
  
  <pre><code>String foo = matcher.group(0);
  </code></pre>