Where is match_info argument in Glib::Regex (gtkmm)

I don’t understand why gtkmm wrapper does not contain GMatchInfo** match_info argument as documented:

My code:

regex = Glib::Regex::create(...)

regex->match(subject, flags, /* match_info */)

Here is compiler options expected:

match(Glib::UStringView string, MatchFlags match_options = static_cast<MatchFlags>(0)) -> bool

Just want to get matches from pattern.

Well, I found another solution by using this method:

std::vector<Glib::ustring> results = Glib::Regex::split_simple(
    regex, 
    subject
);

But strange documentation mismatch with official wrapper api.

There are 6 Glib::Regex::match() overloads, 3 with a match_info parameter, 3 without.
For instance

bool match(Glib::UStringView string, Glib::MatchInfo& match_info,
    MatchFlags match_options = static_cast<MatchFlags>(0));

In g_regex_match() the match_info parameter can be NULL. In Glib::Regex::match()
that corresponds to an overload without a match_info parameter.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.