pcre_compileとpcre_execを使用するときに大文字と小文字を区別するにはどうすればよいですか?
pcre_exec(
pcre_compile(pattern,0,&error,&erroroffset,0),
0, string, strlen(string), 0, 0, ovector, sizeof(ovector));
どのオプションを使用し、どこで指定しますか?
次のようPCRE_CASELESS
に、2番目の引数をに渡す必要があります。pcre_compile
pcre_compile(pattern, PCRE_CASELESS, ...
(そこでメモリリークが発生していることに注意してください。pcre_free
によって返されたオブジェクトを呼び出す必要がありますpcre_compile
。)
PCRE_CASELESS
pcre_compileでフラグを使用できます。
例:
pcre_compile(
pattern, /* the pattern */
PCRE_CASELESS|PCRE_MULTILINE, /* default options */
&error, /* for error message */
&erroffset, /* for error offset */
NULL); /* use default character tables */