1

We are trying to match the German string.

Munich tausendschöne Jungfräulein ausendschçne

We are able to match it with a PCRE regex which uses positive lookahead and a sequence of multiple UTF-8 codepoints.

For example, (?=.+(\x{0068}\x{00F6})){1}.

However, when we add any of the UTF-8 literals, ö, ä, ç into the PCRE regex, pcre_compile() complains about invalid UTF-8 regex string.

using a C/C++ PCRE regex with PCRE_UTF8, PCRE_UCP, PCRE_CASELESS options activated which uses the UTF-8 literals, ö, ä, ç, What might be a valid PCRE regex which uses the UTF-8 literals ö or ä or ç?

4

1 に答える 1

0

PCRE 開発者の Giuseppe D'Angelo は、pcre メーリング リストで私たちの質問に答えました。

可能ですが、コンパイラの実行文字セットが UTF-8 シーケンスを正しく出力するように設定されていることを確認する必要があります。そうですか?pcre_compile に渡す文字列リテラルの 16 進ダンプを取得してみてください (最終的には、アセンブラーの出力を調べてみてください)。

于 2012-06-30T08:08:13.203 に答える