title: Using PCRE_MULTILINE with a caret
body: <p>In a C code, I need to check if a pattern matches on at least one line of a file. I need a caret in my expression. What I have is:</p>
  
  <pre><code>const char *disambiguate_pp(SourceFile *sourcefile) {
          char *p = ohcount_sourcefile_get_contents(sourcefile);
    char *eof = p + ohcount_sourcefile_get_contents_size(sourcefile);
  
          /* prepare regular expressions */
          pcre *re;
          const char *error;
          int erroffset;
          re = pcre_compile("^\\s*(define\\s+[\\w:-]+\\s*\\(|class\\s+[\\w:-]+(\\s+inherits\\s+[\\w:-]+)?\\s*{|node\\s+\\'[\\w:\\.-]+\\'\\s*{)",
                            PCRE_MULTILINE, &amp;error, &amp;erroffset, NULL);
  
          for (; p &lt; eof; p++) {
                  if (pcre_exec(re, NULL, p, mystrnlen(p, 100), 0, 0, NULL, 0) &gt; -1)
                          return LANG_PUPPET;
  
          }
          return LANG_PASCAL;
  }
  </code></pre>
  
  <p>For some reason, the caret seems ignored, as the following line matches the regexp (and should not):</p>
  
  <pre><code>  // update the package block define template (the container for all other
  </code></pre>
  
  <p>I tried a lot of things, but could not get this working. What am I doing wrong?</p>