I have a text document I want to parse through. I want to be able to get the strings between "@5c00\n" and "@ffd2\n" and also between "@ffd2\n" and "@"
@5c00
81 00 00 5C B1 13 3E 01 0C 43 B1 13 A6 00 1C 43
B1 13 38 01 32 D0 10 00 FD 3F 03 43 00 00 00 02
@ffd2
14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C
14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C
14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 00 5C CF 0C
@
q
I have tried to use regular expressions but this seems to give me ['',''].
file = open("app_blink.txt","r") #app_blink.txt being the string above
contents = file.read()
data = re.findall('\n(.*)@',contents,re.M)
I expected to get:
data
['81 00 00 5C B1 13 3E 01 0C 43 B1 13 A6 00 1C 43 \nB1 13 38 01 32 D0 10 00..
FD 3F 03 43 00 00 00 02','14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C..
\n14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C 14 5C \n14 5C 14 5C 14 5C 14..
5C 14 5C 14 5C 00 5C CF 0C \n']
but actually got:
data
['','']