public_sentiment/web/util/re_util.py

20 lines
331 B
Python
Raw Normal View History

2024-09-18 13:41:28 +08:00
#!/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()