3
【笔记】Python3正则表达式最小匹配
source link: https://loli.fj.cn/2023/04/25/Python3%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%9C%80%E5%B0%8F%E5%8C%B9%E9%85%8D/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【笔记】Python3正则表达式最小匹配
2023-04-25
Python3正则表达式最小匹配,匹配第一次成功的条件时就结束匹配
- 在匹配任意字符后添加
?
urls = re.findall("<a>.*?</a>", "<a></a><a></a>")
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK