Author mindauga
Recipients mindauga
Date 2011-04-29.18:27:09
SpamBayes Score 0.0183734
Marked as misclassified No
Message-id <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za>
In-reply-to
Content
re.sub don't substitute not ASCII characters:

Python 2.7.1 (r271:86832, Apr 15 2011, 12:11:58) Arch Linux

>>>import re

>>>a=u'aaa'
>>>print re.search('(\w+)',a,re.U).groups()
(u'aaa')
>>>print re.sub('(\w+)','x',a,re.U)
x

      BUT:

>>>a=u'ąąą'
>>>print re.search('(\w+)',a,re.U).groups()
(u'\u0105\u0105\u0105')
>>>print re.sub('(\w+)','x',a,re.U)
ąąą
History
Date User Action Args
2011-04-29 18:27:10mindaugasetrecipients: + mindauga
2011-04-29 18:27:10mindaugasetmessageid: <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za>
2011-04-29 18:27:10mindaugalinkissue11957 messages
2011-04-29 18:27:09mindaugacreate