Enabling the use of POSIX character classes in Python

Perry Johnson perry at nomail.net.invalid
Sat Dec 11 18:23:43 EST 2010


On 2010-12-11, MRAB wrote:

> On 11/12/2010 17:33, Perry Johnson wrote:
>> Python's re module does not support POSIX character classes, for
>> example [:alpha:]. It is, of course, trivial to simulate them using
>> character ranges when the text to be matched uses the ASCII character
>> set. Sadly, my problem is that I need to process Unicode text. The re
>> module has its own character classes that do support Unicode, however
>> they are not sufficient.
>>
>> I would find it extremely useful if there was information on the
>> Unicode code points that map to each of the POSIX character classes.
>
> Have a look at the new regex implementation on PyPI:
>
>      http://pypi.python.org/pypi/regex

This is exactly what I needed! Thanks!



More information about the Python-list mailing list