Python regex matching Unicode properties

前端 未结 6 1608
我寻月下人不归
我寻月下人不归 2020-11-22 14:49

Perl and some other current regex engines support Unicode properties, such as the category, in a regex. E.g. in Perl you can use \\p{Ll} to match an arbitrary l

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 15:16

    Have you tried Ponyguruma, a Python binding to the Oniguruma regular expression engine? In that engine you can simply say \p{Armenian} to match Armenian characters. \p{Ll} or \p{Zs} work too.

提交回复
热议问题