Method RegEx():setMaxCaptureGroups() Foundation

Sets the maximum number of capture groups.

Syntax
:setMaxCaptureGroups( <nMaxMatchGroups> ) --> self
Parameters
<nMaxMatchGroups>
The new maximum number of capture groups which is allowed in a pattern. The value must be greater or equal to 1. If a smaller value is passed, a value of 1 is used.
Return

This method returns self.

Description

Configures the internal buffer size used for storing capture groups in the match results. By default, 30 groups can be matched including group 0 (the full match). Increase this value when working with patterns that have more capture groups.

Set output vector size

oRegEx := RegEx():create() 
oRegEx:setMaxCaptureGroups(40)  // Support up to 40 capture groups 
// Use oRegEx 
oRegEx:destroy() 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.