有如下字符串:
text=cssPath:"http://imgcache.qq.com/ptlogin/v4/style/32",sig:"OvL7F1OQEojtPkn5x2xdj1*uYPm*H3mpaOf3rs2M",clientip:"82ee3af631dd6ffe",serverip:"",version:"201404010930"
怎么提取元素为sig的值?就是OvL7F1OQEojtPkn5x2xdj1*uYPm*H3mpaOf3rs2M
import re s = 'text=cssPath:"http://imgcache.qq.com/ptlogin/v4/style/32",sig:"OvL7F1OQEojtPkn5x2xdj1*uYPm*H3mpaOf3rs2M",clientip:"82ee3af631dd6ffe",serverip:"",version:"201404010930"' res = re.findall(r'sig:"([^"]+)"',s)
print(res)
print(res[0])
运行结果如下:
['OvL7F1OQEojtPkn5x2xdj1*uYPm*H3mpaOf3rs2M']
OvL7F1OQEojtPkn5x2xdj1*uYPm*H3mpaOf3rs2M