[issue11957] re.sub problem with unicode string

2011-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: The 4th parameter to re.sub() is a count, not flags. -- nosy: +eric.smith ___ Python tracker ___ ___

[issue11957] re.sub problem with unicode string

2011-04-29 Thread Mindaugas
New submission from Mindaugas : 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.sea