You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
580 B

# -*- coding: utf-8 -*-
from snownlp import seg
from snownlp import SnowNLP
import pymysql
import configparser
import os
import re
comment = ' <img alt="[赞]" title="[赞]" src="https://face.t.sinajs.cn/t4/appstyle/expression/ext/normal/e6/2018new_zan_org.png" /> <img alt="[赞]" title="[赞]" src="https://face.t.sinajs.cn/t4/appstyle/expression/ext/normal/e6/2018new_zan_org.png" /> '
non_img_pattern = re.compile(r'<img.*?\/>')
comment = re.sub(non_img_pattern, '', comment)
comment = re.sub(r'\s', '', comment)
print(len(comment))
print(comment)