1 /* $OSSEC, os_regex.c, v0.4, 2006/01/02, Daniel B. Cid$ */
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 /** int OS_Regex(char *pattern, char *str) v0.4
22 * This function is a wrapper around the compile/execute
23 * functions. It should only be used when the pattern is
24 * only going to be used once.
25 * Returns 1 on success or 0 on failure.
27 int OS_Regex(char *pattern, char *str)
32 /* If the compilation failed, we don't need to free anything */
33 if(OSRegex_Compile(pattern, ®, 0))
35 if(OSRegex_Execute(str, ®))
40 OSRegex_FreePattern(®);