python3 清除过滤emoji表情

时间:2019-02-06 00:20:55   收藏:0   阅读:666

https://www.cnblogs.com/lizm166/p/9662995.html

 

def filter_emoji(desstr,restr=‘‘):  
    #过滤表情   
    try:  
        co = re.compile(u‘[\U00010000-\U0010ffff]‘)  
    except re.error:  
        co = re.compile(u‘[\uD800-\uDBFF][\uDC00-\uDFFF]‘)  
    return co.sub(restr, desstr)  

原文:https://www.cnblogs.com/du-jun/p/10353356.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!