GLib.MatchInfo.prototype.expand_references

function expand_references(string_to_expand: String): String {
    // Gjs wrapper for g_match_info_expand_references()
}
  

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.prototype.replace.

The string_to_expand must be UTF-8 encoded even if #G_REGEX_RAW was passed to GLib.Regex.new.

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

match_info may be null in which case string_to_expand must not contain references. For instance "foo\n" does not refer to an actual pattern and '\n' merely will be replaced with \n character, while to expand "\0" (whole match) one needs the result of a match. Use GLib.regex_check_replacement to find out whether string_to_expand contains references.

Since 2.14

string_to_expand

the string to expand

Returns

the expanded string, or null if an error occurred