the list of strings I want to iterate through look like this
{"text":Foo bar\01d"},
out of which I want to extract Foo bar.
I tried
f = open ("file.json", "r")
for line in f.readlines():
#for left side
leftSide = re.compile(r'([^{"text":].*)')
mo = leftSide.findall(line)
for line in f.readlines():
#rightside
rightSide = re.compile(r'.*[\\01d"}$]')
mo2 = rightSide.findall(line)
I have also unsuccessfully tried this answer. Is it possible to match both in one regex or extract the data in one piece?
jsonmodule, use it.json.load(f)