fetch_all


Description:

[ CCode ( array_length = false , array_null_terminated = true ) ]
public string[] fetch_all ()

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.

If a sub pattern didn't match anything (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty string is inserted.

If the last match was obtained using the DFA algorithm, that is using match_all or match_all_full, the retrieved strings are not that matched by sets of parentheses but that of the matched substring. Substrings are matched in reverse order of length, so the first one is the longest match.

The strings are fetched from the string passed to the match function, so you cannot call this function after freeing the string.

Parameters:

this

a MatchInfo structure

Returns:

a null-terminated array of gchar * pointers. It must be freed using strfreev. If the previous match failed null is returned