Method RegEx():getMatchRange() Foundation

Gets the match range from a match result.

Syntax
:getMatchRange( <aMatch>, [<nGroup>] ) --> aRange
Parameters
<aMatch>
An array with match results as returned by :match() or :matchAll().
<nGroup>
The index of the capture group. A value of 0 corresponds to the so-called full match. A value of 1 indicates the first capture group, 2 the second capture group and so on. The default value is 0.
Return

An array with the start and end position positions ({nStart, nEnd}). If no match was found, the array {0,0} is returned.

Description

Helper class method to extract both start and end positions of a match as a two-element array.

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.