$regml » History » Revision 9
« Previous |
| Next »
Per Amundsen, 01/16/2019 09:17 PM
Added in 1.9.0
Returns the Nth regular expression match from $regex, $regsub, $regsubex or from an event.
_Same as $regbr.
See also $regsubex, $regex, $regmlex.
[name] - A named regular expression, if not defined result from the last regular expression is returned. (optional)
N - If N = 0, number of matches, otherwise the Nth match.
.pos - Returns the match position in the text.
.group - Returns the group position (includes empty groups).
; Search the text for the pattern '(hello)' and print the result. //echo -ag Number of matches: $regex(Hello World, /(Hello)/) match 1 is: $regml(1) ; Prefix an event with '$' allows the use of a regular expression in the 'matchtext' field which will fill $regml with the result. on $*:TEXT:/Hello/g:*:echo -ag found $regml(0) matches, first match was $regml(1)
Updated by Per Amundsen about 4 years ago · 9 revisions