I'm looking to extract the id tag from the following field of data:
{"purchased_at":"2020-04-21T05:55:30.000Z","product_desc":"Garnier 2019 Shampoo","onhold":{"copyright":true,"country_codes":["ABC"],"scope":"poss"},"id":"8745485"}
The regex I'm using breaks when this field is encountered as I'm using '"id":\s*"(.*?)"'
.
Because, only some fields have such extra onhold tag:
{"purchased_at":"2020-04-21T05:55:30.000Z","product_desc":"All clear 2019 \n ","id":"7462764"}
The whole file is of the form:
{"info":[{"purchased_at":"","product_desc":"","id":""}{..}]}