问题
I have problem with my Python RegEx treatment bloc when it deals with accented Expression. When I run my code:
import re
title = ur"Titre : c'est pas gréable à Infos:"
print title
m = re.findall(":(.+?) Infos",title , re.UNICODE)
print unicode((m))
i have this result:
Titre : c'est pas gréable à Infos:
[u" c'est pas gr\xe9able \xe0"]
I need to be able to keep accented expression in the result output. Thanks for helping
回答1:
Try this :
print unicode((m), 'utf-8').encode('utf-8')
来源:https://stackoverflow.com/questions/34833482/python-regex-and-accented-expression