但如果你需要在一个字符串中找到所有的regexp匹配,可以使用findall function.
import re
line = 'bla bla bla<form>Form 1</form> some text...<form>Form 2</form> more text?'
matches = re.findall('<form>(.*?)</form>', line, re.DOTALL)
print(matches)
# Output: ['Form 1', 'Form 2']
|
|
温文尔雅的青蛙 · python subprocess模块详解 ...· 2 周前 · |
|
|
直爽的牛肉面 · python/openpyxl/DataVa ...· 1 周前 · |
|
|
长情的火锅 · python读取excel,获得下拉选中所有 ...· 1 周前 · |
|
|
勤奋的鸭蛋 · python - Set up of ...· 昨天 · |
|
|
大力的长颈鹿 · python - Conda env ...· 昨天 · |
|
|
安静的棒棒糖 · 清华大学两岸发展研究院· 1 月前 · |
|
|
酷酷的手术刀 · tgiw 🎃 萬聖節「亂嗌‧電影館」特約 ...· 4 月前 · |
|
|
俊秀的手套 · 文化中国行|中华传统晒书大会晒出黄州“苏轼圈 ...· 4 月前 · |
|
|
留胡子的香菜 · 伦敦足球地理:枪手蓝军热刺领衔英超7队,前八 ...· 1 年前 · |