<p>What is the difference between a <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.group.aspx" rel="nofollow noreferrer">Group</a> and a <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match.aspx" rel="nofollow noreferrer">Match</a> in .NET's RegEx?</p>

[{'answer_id': 29108, 'author': 'Blair Conrad', 'author_id': 1199, 'author_profile': 'https://Stackoverflow.com/users/1199', 'pm_score': 4, 'selected': True, 'text': '<p>A <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match.aspx" rel="noreferrer">Match</a> is an object that indicates a particular regular expression matched (a portion of) the target text. A <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.group.aspx" rel="noreferrer">Group</a> indicates a portion of a match, if the original regular expression contained group markers (basically a pattern in parentheses). For example, with the following code:</p>\n\n<pre><code>string text = "One car red car blue car";\nstring pat = @"(\\w+)\\s+(car)";\nMatch m = r.Match(text);\n</code></pre>\n\n<p><code>m</code> would be match object that contains two groups - group 1, from <code>(\\w+)</code>, and that captured "One", and group 2 (from <code>(car)</code>) that matched, well, "car".</p>\n'}, {'answer_id': 29143, 'author': 'Mats Fredriksson', 'author_id': 2973, 'author_profile': 'https://Stackoverflow.com/users/2973', 'pm_score': 2, 'selected': False, 'text': '<p>A Match is a part of a string that matches the regular expression, and there could therefore be multiple matches within a string.</p>\n\n<p>Inside a Match you can define groups, either anonymous or named, to make it easier to split up a match. A simple example is to create a regex to search for URLs, and then use groups inside to find the protocol (http), domain (www.web.com), path (/lol/cats.html) and arguments and what not. </p>\n\n<pre><code>// Example I made up on the spot, probably doesn\'t work very well\n"(?&lt;protocol&gt;\\w+)://(?&lt;domain&gt;[^/]+)(?&lt;path&gt;/[^?])"\n</code></pre>\n\n<p>A single pattern can be found multiple times inside a string, as I said, so if you use Regex.Matches(string text) you will get back multiple matches, each consisting of zero, one or more groups.</p>\n\n<p>Those named groups can be found by either indexing by number, or with a string. The example above can be used like this:</p>\n\n<pre><code>Match match = pattern.Match(urls);\nif (!match.Success) \n    continue;\nstring protocol = match.Groups["protocol"].Value;\nstring domain = match.Groups[1].Value;\n</code></pre>\n\n<p>To make things even more interesting, one group could be matched multiple times, but then I recommend start reading the <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.group.captures.aspx" rel="nofollow noreferrer">documentation</a>.</p>\n\n<p>You can also use groups to generate back references, and to do partial search and replace, but read more of that on <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.matchcollection.aspx" rel="nofollow noreferrer">MSDN</a>.</p>\n'}]
['https://Stackoverflow.com/questions/29088', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1463/']