python自动化中 使用re 匹配接口返回的是文本类型的数据

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)
posted @ 2021-04-01 10:51  杰的小恒星  阅读(119)  评论(0编辑  收藏  举报