ucd

Python regex matching Unicode properties

眉间皱痕 提交于 2019-11-26 00:44:19
问题 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 lower-case letter, or p{Zs} for any space separator. I don\'t see support for this in either the 2.x nor 3.x lines of Python (with due regrets). Is anybody aware of a good strategy to get a similar effect? Homegrown solutions are welcome. 回答1: Have you tried Ponyguruma, a Python binding to the Oniguruma regular expression engine? In