Letter class in re

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Mar 9 12:11:10 EDT 2015


Antoon Pardon wrote:

> I am using PLY for a parsing task which uses re for the lexical
> analysis. Does anyone
> know what regular expression to use for a sequence of letters? There is
> a class for alphanumerics but I can't find one for just letters, which I
> find odd.
> 
> I am using python 3.4


The re module in Python is pretty old and basic. Can you use Matthew
Barnett's regex module, available on PyPI? I understand it has a richer set
of flags for things such as Unicode letters and the like.



-- 
Steven




More information about the Python-list mailing list