python正则分组匹配
import re s = ''' {"type":"buy","order_no":"2020061613141386691649969"} ''' ret = re.search(r'"type":"(.*?)"', s) print(ret.group()) print(ret.group(0)) print(ret.group(1))
import re s = ''' {"type":"buy","order_no":"2020061613141386691649969"} ''' ret = re.search(r'"type":"(.*?)"', s) print(ret.group()) print(ret.group(0)) print(ret.group(1))