Home Cooker Classes Others Rice CookerGX
Classes  >  regex  >  Group(string,string)
regex class : Group(string,string) method

Description

Gets a string of the group which is specified by the group name.

Syntax

regexInstance.Group(string source, string groupName)

Arguments

ClassNameDescription
stringsourceA string which is searched.
stringgroupNameA group name.

Return value

ClassDescription
stringA string of the group which is specified by the group name.

Sample code

//anyRegex is an any instance of regex type.

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

string result = anyRegex.Group("aaabbbaaccc", "a");//結果は"aaa"。

Notes

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

Links for reference

Copyright © Rice All rights reserved.