Function

GLibRegexEvalCallback

Declaration

gboolean
(* GRegexEvalCallback) (
  const GMatchInfo* match_info,
  GString* result,
  gpointer user_data
)

Description

Specifies the type of the function passed to g_regex_replace_eval(). It is called for each occurrence of the pattern in the string passed to g_regex_replace_eval(), and it should append the replacement to result.

Available since:2.14

Parameters

match_info

Type: GMatchInfo

The GMatchInfo generated by the match. Use g_match_info_get_regex() and g_match_info_get_string() if you need the GRegex or the matched string.

The data is owned by the caller of the function.
result

Type: GString

A GString containing the new string.

The data is owned by the caller of the function.
user_data

Type: gpointer

User data passed to g_regex_replace_eval()

The argument can be NULL.
The data is owned by the caller of the function.

Return value

Type: gboolean

FALSE to continue the replacement process, TRUE to stop it.