4.79. kink/regex/GROUP

4.79.1. type group

A `group` is a slice in the matched text.

A `group` is either the entire region of the match result, or a region which a named capturing group matches.

Example:

:REGEX.require_from('kink/regex/')
:Regex <- REGEX.compile('(?<Lhs>[a-z]+) *= *(?<Rhs>[a-z]+)')
[:M] <- Regex.match('foo = bar')
:Rhs <- M.group('Rhs')
stdout.print_line(Rhs.slice.repr) # => "bar"
stdout.print_line(Rhs.from.repr)  # => 6
stdout.print_line(Rhs.to.repr)    # => 9

4.79.1.1. G.slice

`slice` returns the sliced str of the text where the group matches.

4.79.1.2. G.from

`from` returns the pos from which the group matches in the text.

4.79.1.3. G.to

`to` returns the pos to which the group matches in the text.

4.79.2. GROUP.is?(Val)

`is?` returns whether `Val` is a group val.