python怎么用正则表达式提取出小括号里面的内容
比如从abc(hello)casdf
提取出hello
import re
s = "abc(hello)casdf(world)"
re.findall(r"[(](.*?)[)]",s)
#['hello', 'world']
2 回答5.2k 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
4 回答1.4k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
2 回答895 阅读✓ 已解决
1 回答1.8k 阅读✓ 已解决