6.92. kink/regex/MATCH

6.92.1. type match

The result of a successful regex match or search.

`match` is a subtype of `group`. `match` represents the entire slice of the matched area.

See kink/regex/REGEX for regexes.

See kink/regex/GROUP for `group` type.

6.92.1.1. M.slice

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

Example:

6.92.1.2. M.from

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

Example:

6.92.1.3. M.to

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

Example:

6.92.1.4. M.have_group?(Name)

M.have_group? returns whether the match has the group named as `Name`.

Precondition:

• `Name` must be a str

Example:

See kink/regex/GROUP for groups.

6.92.1.5. M.group(Name)

`group` returns a `group` val of the named group.

Precondition:

• `Name` must be a str

• The match must have the group named as `Name`.

Example:

See kink/regex/GROUP for groups.

6.92.2. MATCH.is?(Val)

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