$regmlex » History » Revision 1
Revision 1/9
| Next »
Per Amundsen, 06/08/2016 02:31 AM
Added in 2.4
$regml([name], M, N)
Returns the Nth regular expression capture group from the Mth match from $regex, $regsub, $regsubex or from an event.
See also $regml.
Parameters
[name] - A named regular expression, if not defined result from the last regular expression is returned. (optional)
M - If M = 0, number of matches, otherwise the Mth match.
N - The Nth group.
Properties
.pos - Returns the match position in the text.
.group - Returns the group position (includes empty groups).
Example
; Search the text for the pattern 'abcdef' and print the result. //echo -ag Number of matches: $regex(abcdef,/([a-z])([a-z])/g) - First march, first group is: $regmlex(1,1) First march, Second group is: $regmlex(1,2) Second match, First group is: $regmlex(2,1) Second match, Second group is: $regmlex(2,2)
Updated by Per Amundsen over 8 years ago · 1 revisions