From: Florian Forster Date: Sun, 23 Nov 2008 18:07:10 +0000 (+0100) Subject: regex match: Require *all* regular expressions to match. X-Git-Tag: collectd-4.6.0~144 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=eb30b842f4ee4d68f68d8a6ba17e0109b6777565;p=collectd.git regex match: Require *all* regular expressions to match. Before, when there were multiple regular expressions for the same field, for example the host, only of of those regular expressions needed to match for a successful overall match. The new behavior is not that *all* regular expressions need to match for a successful overall match. This makes the behavior much easier to understand. --- diff --git a/src/match_regex.c b/src/match_regex.c index 15f3c774..9233d803 100644 --- a/src/match_regex.c +++ b/src/match_regex.c @@ -109,17 +109,17 @@ static int mr_match_regexen (mr_regex_t *re_head, /* {{{ */ { DEBUG ("regex match: Regular expression `%s' matches `%s'.", re->re_str, string); - return (FC_MATCH_MATCHES); } else { DEBUG ("regex match: Regular expression `%s' does not match `%s'.", re->re_str, string); + return (FC_MATCH_NO_MATCH); } } - return (FC_MATCH_NO_MATCH); + return (FC_MATCH_MATCHES); } /* }}} int mr_match_regexen */ static int mr_config_add_regex (mr_regex_t **re_head, /* {{{ */