Re: [pcre-dev] \p{Han} does not work in pcregrep

トップ ページ
このメッセージを削除
著者: Petr Pisar
日付:  
To: pcre-dev
題目: Re: [pcre-dev] \p{Han} does not work in pcregrep
On Mon, May 11, 2020 at 10:17:47AM +0100, Ben Phillips via Pcre-dev wrote:
> I would like to report an issue with pcregrep; \p{Han} does not appear to
> match chinese characters.
>

I suspect you forgot to enable UTF-8 mode with "-u" option:

$ printf '中\n' | pcregrep -u '\p{Han}'


Otherwise all matching is performed in non-Unicode mode where most of the Unicode
properties, like the Han script, do not exist.

-- Petr