Skip to content

Match

[Source]

Contains match data for a combination of a regex and a subject.

class ref Match

Public Functions

size

[Source]

Returns the capture size of the match.

fun box size()
: U32 val

Returns


start_pos

[Source]

Returns the character position of the first character in the match.

fun box start_pos()
: USize val

Returns


end_pos

[Source]

Returns the character position of the last character in the match.

fun box end_pos()
: USize val

Returns


apply[optional A: ((String iso | Array[U8 val] iso) & Seq[U8 val] iso)]

[Source]

Returns a capture by number. Raises an error if the index is out of bounds.

fun box apply[optional A: ((String iso | Array[U8 val] iso) & Seq[U8 val] iso)](
  i: U32 val)
: A^ ?

Parameters

Returns

  • A^ ?

find[optional A: ((String iso | Array[U8 val] iso) & Seq[U8 val] iso)]

[Source]

Returns a capture by name. Raises an error if the named capture does not exist.

fun box find[optional A: ((String iso | Array[U8 val] iso) & Seq[U8 val] iso)](
  name: String box)
: A^ ?

Parameters

Returns

  • A^ ?

groups

[Source]

Returns all of the captured subgroups. Groups that failed to capture anything will contain the empty string.

fun box groups()
: Array[String val] iso^

Returns


dispose

[Source]

Free the underlying PCRE2 data.

fun ref dispose()
: None val

Returns