MatchInfo

class MatchInfo(pointer: <Error class: unknown class><<Error class: unknown class>>) : Record

A GMatchInfo is an opaque struct used to return information about matches.

Skipped during bindings generation

  • parameter start_pos: start_pos: Out parameter is not supported

  • parameter start_pos: start_pos: Out parameter is not supported

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion : RecordCompanion<MatchInfo, <Error class: unknown class>>

Properties

Link copied to clipboard
val glibMatchInfoPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun expandReferences(stringToExpand: String): <Error class: unknown class><String>

Returns a new string containing the text in @string_to_expand with references and escape sequences expanded. References refer to the last match done with @string against @regex and have the same syntax used by g_regex_replace().

Link copied to clipboard
fun fetch(matchNum: Int): String

Retrieves the text matching the @match_num'th capturing parentheses. 0 is the full text of the match, 1 is the first paren set, 2 the second, and so on.

Link copied to clipboard

Bundles up pointers to each of the matching substrings from a match and stores them in an array of gchar pointers. The first element in the returned array is the match number 0, i.e. the entire matched text.

Link copied to clipboard

Retrieves the text matching the capturing parentheses named @name.

Link copied to clipboard
fun free()

If @match_info is not null, calls g_match_info_unref(); otherwise does nothing.

Link copied to clipboard

Retrieves the number of matched substrings (including substring 0, that is the whole matched text), so 1 is returned if the pattern has no substrings in it and 0 is returned if the match failed.

Link copied to clipboard

Returns #GRegex object used in @match_info. It belongs to Glib and must not be freed. Use g_regex_ref() if you need to keep it after you free @match_info object.

Link copied to clipboard

Returns the string searched with @match_info. This is the string passed to g_regex_match() or g_regex_replace() so you may not free it before calling this function.

Link copied to clipboard

Usually if the string passed to g_regex_match*() matches as far as it goes, but is too short to match the entire pattern, false is returned. There are circumstances where it might be helpful to distinguish this case from other cases in which there is no match.

Link copied to clipboard

Returns whether the previous match operation succeeded.

Link copied to clipboard
fun next(): <Error class: unknown class><Boolean>

Scans for the next match using the same parameters of the previous call to g_regex_match_full() or g_regex_match() that returned

Link copied to clipboard
fun ref(): MatchInfo

Increases reference count of @match_info by 1.

Link copied to clipboard
fun unref()

Decreases reference count of @match_info by 1. When reference count drops to zero, it frees all the memory associated with the match_info structure.