klyn.regex.RegExMatcher.end
method
public native end(index as Long = 0) as Long
Description

Returns the exclusive end offset of a captured group in the input. Offsets count Unicode characters, like String indexing, not UTF-8 bytes.

Parameters
ParameterDescription
indexZero-based capture-group index. Group 0 is the full match.
Returns

The absolute end offset, or -1 for an unmatched optional group.

Throws
  • IllegalStateException if no successful match is current.
  • IndexException if the group index is invalid.
Example
matcher = RegEx(r"\d+").matcher("value=42")
if matcher.find():
    print(matcher.end())  # 8