diff --git a/lib/filterx/expr-regexp-subst.c b/lib/filterx/expr-regexp-subst.c index 4dc1ad2ba..ba6d2bb95 100644 --- a/lib/filterx/expr-regexp-subst.c +++ b/lib/filterx/expr-regexp-subst.c @@ -295,6 +295,13 @@ _extract_optional_flags(FilterXFuncRegexpSubst *self, FilterXFunctionArgs *args, return TRUE; } +static gboolean +_contains_match_grp_ref(gchar *str) +{ + gchar *close = NULL; + return _next_matchgrp_ref(str, &close) != NULL; +} + static gboolean _extract_subst_args(FilterXFuncRegexpSubst *self, FilterXFunctionArgs *args, GError **error) { @@ -366,7 +373,8 @@ filterx_function_regexp_subst_new(FilterXFunctionArgs *args, GError **error) self->super.super.deinit = _subst_deinit; self->super.super.free_fn = _subst_free; - reset_flags(&self->flags, FLAG_VAL(FILTERX_FUNC_REGEXP_SUBST_FLAG_JIT)); + reset_flags(&self->flags, FLAG_VAL(FILTERX_FUNC_REGEXP_SUBST_FLAG_JIT) | FLAG_VAL( + FILTERX_FUNC_REGEXP_SUBST_FLAG_GROUPS)); if (!_extract_subst_args(self, args, error) || !filterx_function_args_check(args, error)) goto error;