python3 清除过滤emoji表情

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)  

猜你喜欢

转载自www.cnblogs.com/du-jun/p/10353356.html
今日推荐