import re
t =‘wwsererfgfgfh({"productId":"111111","wwww":"323243":{}})‘
# m = re.match("\W*productId[^:]*:\D*(\d+)", t)
# if m:
# print(m.group(1))
re_prodId=re.compile(r‘\"productId\":\"([^"]+)\"‘)
re=re_prodId.findall(t)
print(re)
python自动化中 使用re 匹配接口返回的是文本类型的数据
原文:https://www.cnblogs.com/zhangjie198212/p/14605285.html