Result = RegularExpressionGroupPosition(#RegularExpression, Group)
Returns the position (within the current matching string) of the specified group after a call to NextRegularExpressionMatch().


#RegularExpression The regular expression to use. ExamineRegularExpression() and NextRegularExpressionMatch() must have been called on this regular expression.
Group The index of the group. The first group has index 1.

Return value

Returns the character position of the group within the matching string (not within the orginal input string!). The first character of the match has position 1.


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. The CountRegularExpressionGroups() function can be used to find out the number of groups in a regular expression.

As an alternative, the RegularExpressionNamedGroupPosition() function can be used.

See Also

ExamineRegularExpression(), NextRegularExpressionMatch(), RegularExpressionGroup(), RegularExpressionGroupLength(), RegularExpressionNamedGroupPosition()

Supported OS


<- RegularExpressionGroupLength() - RegularExpression Index - RegularExpressionMatchLength() ->