Method RegEx():getMatchPos() Foundation

Gets the match position from a match result.

Syntax
:getMatchPos( <aMatch>, [<nGroup>] ) --> nPosition
Parameters
<aMatch>
An array with match results as returned by :match() or :matchAll().
<nGroup>
The index of the capture group to process. 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

The starting position of match or 0 if no match was found.

Description

Helper class method to safely extract the starting position of a match from a match result 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.