Enabling the use of POSIX character classes in Python

MRAB python at mrabarnett.plus.com
Sat Dec 11 12:58:06 EST 2010


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



More information about the Python-list mailing list