Take the 2-minute tour ×

Possible Duplicate:
Detect chinese character using perl?

Is there any way to detect Chinese character using Perl?

And is there any way on how to split Chinese character with symbol dot '.' perfectly?

share|improve this question

migrated from webapps.stackexchange.com Aug 4 '11 at 9:37


marked as duplicate by daxim, bmargulies, Robert Harvey Aug 5 '11 at 4:17


Detect chinese character using perl? in webapps.stackexchange.com is post by me, thanks. –  deepWebMie Aug 26 '11 at 6:10

1 Answer 1

something like

use utf8;

my $str = "a银行系统时间表";
$str =~ m/(\p{Han}+)/;
print join('.', split(//, $1));



PS: I can't read/speak chinese so I have no idea about what $str says. If it's rude soz ^^

share|improve this answer
In general, you can look up names of scripts in the perluniprops documentation –  Leon Timmermans Aug 4 '11 at 12:49
It says "Schedule for the banking system" so don't worry. Also China usually uses 。 for punctuation rather than '.' at the end of a sentence. –  Rincewind42 Aug 4 '11 at 14:49
@Rincewind42 oki thx. Yeah it was came from HSBC website ^^ –  Kakawait Aug 4 '11 at 15:01
well, I need to split 银.行.系.统.时.间.表 to 银行系统时间表. –  deepWebMie Aug 26 '11 at 6:11
