3.73. kink/regex/GROUP

3.73.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.


: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


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


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


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

3.73.2. GROUP.is?(Val)

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