Link Search Menu Expand Document

RegexMatcher.End Method

Explanation Gets the tail index of the matched result.

Able to specify group to get the tail index of a substring forward-referenced by a group of regular expression patterns.
Groups are numbered from left to right, starting with 1 , and group 0 represents the entire pattern.

Regular expression patterns such as "(a) *" may match the empty string. In this case it returns -1. However, if you specify 0 for the group number, 0 is returned.
Call format var e = rm.End( [ group ] )
Return value End index of matched part or forward reference group.
(The tail index points to the next position at the end of the string).
From Ver.5.0.1, the index is in character units in Unicode mode.Other than that, it is in bytes.
Arguments integer group The number of the forward reference group you want to get.
If omitted, it will be 0 (entire pattern).
Exception Func 4 The argument value is invalid
Func 14 The value cannot be referenced
Example of use
var m = RegexPattern.Compile("Biz/([a-zA-Z]+)").Matcher("Biz/Browser");
if (m.Matches()) {
    print(m.Start(1), m.End(1), m.Group(1), "\n");
}
    
Related item Start, Group methods