【发布时间】:2017-04-15 14:53:04
【问题描述】:
import re
b="united thats weak. See ya ????"
print b.decode('utf-8') #output: u'united thats weak. See ya \U0001f44b'
print re.findall(r'[\U0001f600-\U0001f650]',b.decode('utf-8'),flags=re.U) # output: [u'S']
如何获得输出\U0001f44b。请帮忙
我需要处理的表情符号是“??????❤️?????????????????????????????????????????????? ???????????????????????????? ?????????????????????????????????????????????????????????????????? ???????????????????????????? ?????????????????????????????????????????????????????????????????? ???????????????????????????? ?????????????????????????????????????????????????????????????????? ???????????????????????????? ?????????????????????????????????????????????????????????????????? ???????????????????????????? ?????????????????????????????????????????????????????????????????? ?????? ??????????????????????????? ??????????????????????????????????????????????????????????????? ??????????????????????????? ??????????????????????????????????????????????????????????????? ??????????????????????????? ??????????????????????????????????????????????????????????????? ??????????????????????????? ???????????”
【问题讨论】:
-
这是否意味着您只需要匹配一些表情符号?
-
是的...我正在尝试这样做...但不知何故无法写出准确的模式
-
你能用所有你想匹配的表情来更新你的问题吗?谢谢。
-
嗨 Qubad....我只需要一种使用正则表达式来处理表情符号的方法...它不是关于特定表情符号的更多信息。感谢您的回复:)
标签: python regex python-2.7 unicode python-unicode