greetings,

I was doing the log statistics stuff using perl.
There are chinese characters in log items.
I tried with regex to match them, but got no luck.

$ perl -mstrict -le 'my $char="汉语"; print "it is chinese" if $char =~ /\p{Han}+/'

$ perl -mstrict -mutf8 -le 'my $char="汉语"; print "it is chinese" if $char =~ /\p{Han}+/'

both output nothing.

My terminal is UTF-8:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


Can you help? thanks in advance.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to