假设字符串“a= {};” 要截取包含花括号在内的内容
import re pattern= r= "= (.+?);" match_bet_list=eval(re.findall(pattern,match_bet_list,re.M)[0])
re.M表示在字符串每行中截取
https://blog.csdn.net/bang152101/article/details/89284249