Slide 34
Slide 34 text
34
PHP PCRE
match Han (Chinese, Japanese, Korean - CJK)
add Latin, which includes the English alphabet
add Common, which includes punctuation
⾒見見 en.wikipedia.org/wiki/Latin_script_in_Unicode
$s="⼩小⼭山";
preg_match("/^\p{Han}+$/u",$s);
$s="André is ⼩小⼭山";
preg_match("/^(\p{Han}|\p{Latin}|\s)+$/u",$s);
$s="Andréʼs adopted Chinese name is ⼩小⼭山!";
preg_match("/^(\p{Han}|\p{Latin}|\p{Common})+$/u",$s);