emojiutil.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Python 作者: Guzi219 项目源码 文件源码
def remove_emoji(desstr,restr=''):
    try:
        highpoints = re.compile(u'([\U00002600-\U000027BF])|([\U0001f300-\U0001f64F])|([\U0001f680-\U0001f6FF])')
        print 'remove emoji now.'
    except re.error:
        print 'failed to remove emoji.'
        highpoints = re.compile(u'([\u2600-\u27BF])|([\uD83C][\uDF00-\uDFFF])|([\uD83D][\uDC00-\uDE4F])|([\uD83D][\uDE80-\uDEFF])')
        # mytext = u'<some string containing 4-byte chars>'
        desstr = highpoints.sub(u'\u25FD', desstr)
    return desstr
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号