GLib.MatchInfo.fetch_all

### Method

# GLib MatchInfofetch_all

since: 2.14

#### Declaration [src]

    gchar**
    g_match_info_fetch_all (
      const GMatchInfo* match_info
    )

#### Description [src]

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.

When a partial match is reported via `g_match_info_is_partial_match()` only the full text of the match will be returned, i.e. an array of size 1.

If the last match was obtained using the DFA algorithm, that is using `g_regex_match_all()` or g_regex_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.

Available since: 2.14

#### Return value

Type: An array of `utf8`

A `NULL`-terminated array of gchar * pointers. It must be freed using g_strfreev(). If the previous match failed `NULL` is returned.

The array is `NULL`-terminated.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.
Each element is a NUL terminated UTF-8 string.