MatchInfo

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

Members

Functions

expandReferences
string expandReferences(string stringToExpand)

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 glib.regex.Regex.replace.

fetch
string fetch(int matchNum)

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.

fetchAll
string[] fetchAll()

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.

fetchNamed
string fetchNamed(string name)

Retrieves the text matching the capturing parentheses named name.

fetchNamedPos
bool fetchNamedPos(string name, int startPos, int endPos)

Retrieves the position in bytes of the capturing parentheses named name.

fetchPos
bool fetchPos(int matchNum, int startPos, int endPos)

Retrieves the position in bytes of 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.

getMatchCount
int getMatchCount()

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.

getRegex
glib.regex.Regex getRegex()

Returns #GRegex object used in match_info. It belongs to Glib and must not be freed. Use glib.regex.Regex.ref_ if you need to keep it after you free match_info object.

getString
string getString()

Returns the string searched with match_info. This is the string passed to glib.regex.Regex.match or glib.regex.Regex.replace so you may not free it before calling this function.

isPartialMatch
bool isPartialMatch()

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.

matches
bool matches()

Returns whether the previous match operation succeeded.

next
bool next()

Scans for the next match using the same parameters of the previous call to glib.regex.Regex.matchFull or glib.regex.Regex.match that returned match_info.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.