Hi,
Basic question, not clear to me for the regcomp man.
If I have a static instance of regex_t, can I reuse it for several compilation without freeing it every time, something like:
int match(char* pattern, char* name) {
static regex_t re;
regcomp(&re,pattern,REG_EXTENDED|REG_NOSUB);
...
}
The code itself is bit more complicated, and the idea is to use static variable to save compilation if the pattern was not changed between calls. The question is if I need to call regfree before each new regcomp.
Thanks.