mu-regex: add match_groups, use everywhere

Add match_groups to Mu::Regex, and update old "raw" GRegex users.
This commit is contained in:
Dirk-Jan C. Binnema
2026-07-23 13:38:38 +03:00
committed by Seth Ladygo
parent 31e5c7b34e
commit 7e83f5e4b0
6 changed files with 122 additions and 46 deletions

View File

@ -31,6 +31,7 @@
#include "utils/mu-utils.hh"
#include "utils/mu-utils-file.hh"
#include "utils/mu-result.hh"
#include "utils/mu-regex.hh"
using namespace Mu;
@ -135,7 +136,7 @@ test_maildir_mkdir_05(void)
[[maybe_unused]] static void
assert_matches_regexp(const char* str, const char* rx)
{
if (!g_regex_match_simple(rx, str, (GRegexCompileFlags)0, (GRegexMatchFlags)0)) {
if (const auto rex{Regex::make(rx)}; !rex || !rex->matches(str)) {
if (g_test_verbose())
g_print("%s does not match %s", str, rx);
g_assert(0);