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

Top Page
Delete this message
Author: Petr Pisar
Date:  
To: pcre-dev
Subject: 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