结构体
GLibMatchInfo
实例方法
g_match_info_expand_references
返回中包含文本的新字符串 string_to_expand,使用引用和转义序列进行扩展。引用参考针对 regex 执行的 string 的上次匹配,并且具有与 g_regex_replace() 所使用的相同的语法。
自 2.14 起
g_match_info_fetch_all
捆绑指向匹配 substrings 中每个 substrings 的指针,并将它们存储在 gchar 指针数组中。返回数组中第一个元素是匹配编号 0,即整个匹配的文本。
自 2.14 起
g_match_info_get_match_count
检索匹配 substrings 的数量(包括 substring 0,即整个匹配文本),因此如果模式中没有 substrings,则返回 1,如果匹配失败,则返回 0。
自 2.14 起
g_match_info_get_regex
返回用于 match_info 的 GRegex 对象。它属于 Glib,且不可释放。如果您需要在释放 match_info 对象后保留该对象,请使用 g_regex_ref()。
自 2.14 起
g_match_info_get_string
返回使用 match_info 搜索的字符串。这是传递给 g_regex_match() 或 g_regex_replace() 的字符串,因此您可能在调用此函数之前释放该字符串。
自 2.14 起
g_match_info_is_partial_match
通常,如果传递给 g_regex_match*() 的字符串部分匹配,但长度不足以匹配整个模式,则返回 FALSE。在某些情况下,将此用例与无匹配的其他用例区分开来可能会有帮助。
自 2.14 起
g_match_info_next
使用返回 match_info 的上一次对 g_regex_match_full() 或 g_regex_match() 调用的相同参数扫描以查找下一个匹配项。
自 2.14 起