我想要在一个字符串中提取一些特定的内容,并把它们保存在一个变量中。
例如:
原字符串:
str = '{"ok":true,"result":[{"update_id":40,"message":{"message_id":62,"chat":{"id":76166858,"type":1},"from":{"id":76166858,"first_name":"Mike","last_name":"Qin","username":""},"text":"你好","date":1675146092},"lang":"zh-CN","os_type":"android"}]}'
我需要里面的chat_id(即字符串中的"chat":{"id":76166858,"type":1}),例子中是:76166858
请问如何提取并将它储存在变量中?