但如果你需要在一个字符串中找到所有的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']
|
|
欢快的香烟 · 将Mathematica生成的不规则形状数组 ...· 4 月前 · |
|
|
烦恼的水桶 · python用符号拼接DataFrame两列 ...· 4 月前 · |
|
|
斯文的杯子 · Python+Django 核心介绍 - ...· 3 月前 · |
|
|
愤怒的风衣 · Python 异步 ASGI ...· 3 月前 · |
|
|
奔跑的骆驼 · 结合使用 Oracle Database ...· 3 月前 · |
|
|
内向的冲锋衣 · 提升 SQLite 效能的最佳做法 | ...· 8 月前 · |
|
|
傻傻的开水瓶 · 隱私權 - 功能特色 - Apple (台灣)· 11 月前 · |
|
|
飞奔的灯泡 · 广东:医生被砍30刀垂危 ...· 1 年前 · |
|
|
很拉风的啄木鸟 · std::begin and ...· 1 年前 · |
|
|
气宇轩昂的眼镜 · 细数历届诺贝尔经济学奖得主!· 1 年前 · |
|
|
烦恼的水桶 · python用符号拼接DataFrame两列开发者社区 4 月前 |
|
|
愤怒的风衣 · Python 异步 ASGI 服务器及框架开发者社区 3 月前 |
|
|
傻傻的开水瓶 · 隱私權 - 功能特色 - Apple (台灣) 11 月前 |
|
|
很拉风的啄木鸟 · std::begin and std::end usage without specifying std namespace · Issue #2359 · nlohmann/json · GitHu 1 年前 |
|
|
气宇轩昂的眼镜 · 细数历届诺贝尔经济学奖得主! 1 年前 |