正则匹配所有网址
在短信等其它文本中,经常会出现一些网址,可以通过正则提取。
1、python
import re
# 所有网址的正则
url_compile=re.compile("[http://|ftp://|https://|www]?[^\u4e00-\u9fa5\s]*?\.[com|net|cn|me|tw|fr][^\u4e00-\u9fa5\s]*")
result1=url_compile.findall("您已节省0.01元,通过农行卡****支付446.39元。本次支付送您免单机会!速戳→
原创
2020-06-16 17:32:06 ·
5201 阅读 ·
0 评论