Perl 與 Python 在 Unicode 的處理

我試著在 上找到 Perl Regular Expression 有提供的 General Category Property,不過沒有找到。而且發現 沒有使用

先參考 上的文件, 這篇,在 Regular Expression 裡使用 General Category Property 指的是 \p{Lu} 這種用法,前面的範例表示大寫字母 (Uppercase Letter),我在用 切詞的時候用了兩次這種 Regular Expression。

替代的方案是依照 裡的說法去找對應的範圍,然後自己寫 Regular Expression。

Update 比較清楚,直接把 Hex Start 與 Hex End 列出來。

Leave a Reply

Your email address will not be published. Required fields are marked *