1 /* @(#) $Id: regex_op.c,v 1.12 2009/06/24 18:53:08 dcid Exp $ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 3) as published by the FSF - Free Software
20 * Compile a posix regex, returning NULL on error
21 * Returns 1 if matches, 0 if not.
23 int OS_PRegex(char *str, char *regex)
31 if(regcomp(&preg, regex, REG_EXTENDED|REG_NOSUB) != 0)
33 merror("%s: Posix Regex compile error (%s).", __local_name, regex);
37 if(regexec(&preg, str, strlen(str), NULL, 0) != 0)