I have a line like this:
a = '5:::{"test":[{"a":1,"b":2},{"a":2,"b":3}]}4:::{"something":[{"d":1,"e":2},{"d":2,"e":3}]}'
I would like to break this down into a list with values:
['5:::{"test":[{"a":1,"b":2},{"a":2,"b":3}]}','4:::{"something":[{"d":1,"e":2},{"d":2,"e":3}]}']
I tried regular expressions as follows:
b = re.findall(r'[0-9]:::.*(?=[0-9]:::)|(?=$)',a)
tries to combine parts starting with a digit, and then three colons, then any character until it is reached anywhere [0-9]: or the end of a line. This seems completely wrong, but I don't understand how to proceed here.
thanks Marcus
source share