From 4cfbf894fd0caebaf65e1b7ffcb5725a530cf67d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 11 Nov 2008 12:00:11 +0100 Subject: enhance: regex nomatch option "ZERO" has been added This allows to return the string 0 if a regular expression is not found. This is probably useful for storing numerical values into database columns. --- runtime/msg.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/msg.c') diff --git a/runtime/msg.c b/runtime/msg.c index fcd4a6d3..c8dbf2c2 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -1936,6 +1936,8 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, } if(pTpe->data.field.nomatchAction == TPL_REGEX_NOMATCH_USE_DFLTSTR) return "**NO MATCH**"; + else if(pTpe->data.field.nomatchAction == TPL_REGEX_NOMATCH_USE_ZERO) + return "0"; else return ""; } -- cgit v1.2.3