Class
UMatch
In: uregex.c
Parent: Object

Class to store information about capturing groups. Used in UString#sub, UString#gsub methods, as parameter to passed block.

All Methods

[], range, size,
Public Instance methods
umatch[idx] => string

Returns capture group. Group 0 is for full match.

umatch.range(idx) => range

Returns range (start, end) of capture group. Group 0 is for full match.

NOTE: this method returns code unit indexes. To convert this range to code point range use UString#conv_unit_range. If your chars don’t require surrogate UTF16 pairs, range will be the same.

umatch.size => fixnum

Returns number of capture groups.