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

Description

Gets the number of groups.

Syntax

regexInstance.GroupCount(string source)

Arguments

ClassNameDescription
stringsourceA string which is searched.

Return value

ClassDescription
intThe number of groups.

Sample code

//anyRegex is an any instance of regex type.

regex anyRegex = new regex("(a+)");

int count = anyRegex.GroupCount("aaabbbaaccc");

Notes

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

Links for reference

Copyright © Rice All rights reserved.