12
src/regex.c
12
src/regex.c
@ -49,6 +49,18 @@ struct regex *regex_new(const char *pattern) {
|
||||
return re;
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees the given regular expression. It must not be used afterwards!
|
||||
*
|
||||
*/
|
||||
void regex_free(struct regex *regex) {
|
||||
if (!regex)
|
||||
return;
|
||||
FREE(regex->pattern);
|
||||
FREE(regex->regex);
|
||||
FREE(regex->extra);
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if the given regular expression matches the given input and returns
|
||||
* true if it does. In either case, it logs the outcome using LOG(), so it will
|
||||
|
Reference in New Issue
Block a user