1 /* @(#) $Id: ./src/shared/regex_op.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
21 * Compile a posix regex, returning NULL on error
22 * Returns 1 if matches, 0 if not.
24 int OS_PRegex(char *str, char *regex)
32 if(regcomp(&preg, regex, REG_EXTENDED|REG_NOSUB) != 0)
34 merror("%s: Posix Regex compile error (%s).", __local_name, regex);
38 if(regexec(&preg, str, strlen(str), NULL, 0) != 0)