python regex [:alpha:] -


i'm using regex in python:

import re  >>> er = re.compile('^\w{0,30}$', re.u)  >>> er.sub('.', 'maçã')  >>>.... 

but wanna catch letters, [a-z] not work me, because need letters accent . there way use posix? [:alpha:], or solution?

thanks!

modified regex - how about

er = re.compile(u'^[^\w\d_]{1,30}$', re.u) s = er.sub(u'.', u'maçã') 

matches u'maçã' not u'maçã01'.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -