Home Notices Documents Classes Download Others Rice
Classes  >  regex  >  Group(string,string)
regex class : Group(string,string) method

This method has been abolished in Rtype.Regex.dll Ver 1.0.0.1.

Description

Gets a new string that match a group regular expression pattern that is selected by group name in the argument.

Syntax

regexInstance.Group(string source, string groupName)

Arguments

ClassNameDescription
stringsourceA string which is searched.
stringgroupNameA group name.

Return value

ClassDescription
stringA new string that match a group regular expression pattern that is selected by group name.

Sample code

1:

regex pattern = new regex("(?<a>a+)");

2:

string result = pattern.Group("aaabbbaaccc", "a");// result is "aaa".

Notes

It's a wrapper of the System.Text.RegularExpressions.Match.Groups property.

If there are 2 or more strings that match by the group name, the first matching string is returned.

This method has been abolished in Rtype.Regex.dll Ver 1.0.0.1.

Links for reference

Copyright © Rice All rights reserved.