Group Class and GroupCollection Class

Overview

  • Contains the named and unnamed results of matches in a regex.
    • Unnamed results are numbered starting from 1.

Examples

Scanning Text

string input = "The dog ate a bone.";
string regex = @"^The (?<animal>\w+)\b ate (?<food>.+)\.$";
 
Match m = Regex.Match(input, regex);
Console.WriteLine(string.Format("Animal: {0}, Food: {1}!", m.Groups["animal"], m.Groups[2]));
 
learning/exam70-536/group.txt · Last modified: 2008/08/28 11:28 by david
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki