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