立即学习:https://edu.csdn.net/course/play/24756/280711?utm_source=blogtoedu
分组:()
text="apple price is $99, orange price is $99'
result=re.search('.+(\$\d+).+(\$\d+)',text)
print(result,group(1))输出$99
group()/group(0)匹配整个分组
group(1)匹配第一个分组
group(2)匹配第二个分组
groups()获取所有分组:如print(result,groups())输出('$99','$88')