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
Post a Comment