python计算字符串长度(纯中文)

微信扫一扫,分享到朋友圈

python计算字符串长度(纯中文)
收藏 01
def get_content_wordnumber(html):
    text =re.sub('[\s+\.\!\/_,$%^*(+\"\']+|[+——!,::。?、~@#¥%……&*()“”《》]','',html)
    text2 = re.sub('<[^>]*?>', '', text)
    words_number = len(text2)
    return words_number

 

一个热爱互联网的咸鱼
上一篇

帝国cms自建一个表根据分类id调取作者信息

下一篇

帝国CMS列表内容页模板(list.var)调取栏目名称的方法

你也可能喜欢

1 条评论

  1. I was excited to uncover this website. I need to to thank you for ones time for this particularly fantastic read!! I definitely really liked every part of it and i also have you bookmarked to look at new things in your site.

发表评论

您的电子邮件地址不会被公开。 必填项已用 * 标注

提示:点击验证后方可评论!

插入图片

热门

    抱歉,30天内未发布文章!
返回顶部