public_sentiment/web/util/re_util.py
2024-09-18 13:38:24 +08:00

20 lines
331 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
class ReUtil:
"""
正则表达式的工具类
"""
@staticmethod
def clear_html(text_with_html):
"""
清除html
"""
soup = BeautifulSoup(text_with_html, 'html.parser')
return soup.get_text()