title: Can I use regex_t for several compilations
body: <p>Basic question, not clear to me for the regcomp man.</p>
  
  <p>If I have a static instance of regex_t, can I reuse it for several compilation without freeing it every time, something like:</p>
  
  <pre><code>    int match(char* pattern, char* name) {
         static regex_t re;
         regcomp(&amp;re,pattern,REG_EXTENDED|REG_NOSUB);
        ...
      }
  </code></pre>
  
  <p>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.</p>
  
  <p>Thanks.</p>