摘要:
学习正则表达式的基本用法。 使用Python进行文本清洗。 import re def clean_text(text): text = re.sub(r'\s+', ' ', text) # 去除多余空格 text = re.sub(r'[^\w\s]', '', text) # 去除标点符号 r 阅读全文
posted @ 2025-01-14 19:51
雨愈
阅读(17)
评论(0)
推荐(0)
浙公网安备 33010602011771号