CountRegularExpressionGroups()

Syntax

Result = CountRegularExpressionGroups(#RegularExpression)
Description
Returns the number of groups defined in the #RegularExpression. The matches of regular expression groups can be accessed with functions like RegularExpressionGroup().

Parameters

#RegularExpression The regular expression to use.

Return value

The number of groups defined in the regular expression.

Remarks

Groups in a regular expression are defined by surrounding a sub-expression with braces "(" and ")". The groups are numbered as they appear in the regular expression from left to right. The first group has index 1.

See Also

RegularExpressionGroup()

Supported OS

All

RegularExpression Index - CreateRegularExpression() ->