← Standard library

Match

struct Match
import Match from Wax;

A successful regular-expression match retaining its source string and capture positions. Public offsets and lengths count UTF-8 bytes. Group zero is the whole match; unmatched groups are represented separately from matched empty groups.

Regex.wax:708

Members

indexgetter

public get index() : int32

The zero-based byte offset of the whole match.

Regex.wax:729

lengthgetter

public get length() : int32

The UTF-8 byte length of the whole match, which may be zero.

Regex.wax:733

valuegetter

public get value() : StringSlice

Borrows the matched bytes as a string slice.

Regex.wax:738

groupCountgetter

public get groupCount() : int32

The number of capture slots, including slot zero for the whole match.

Regex.wax:745

GroupAtmethod

public fn GroupAt(int32 idx) : RegexGroup

Returns a capture by an in-range zero-based index; out-of-range indices panic. An unmatched capture has isMatch == false, index -1, and length zero.

Regex.wax:753

GroupNamedmethod

public fn GroupNamed(string name) : RegexGroup

Returns a named capture. Unknown or unmatched names produce a nonmatching group with empty value.

Regex.wax:770

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.