I have the following code that matches almost everything I need it to.
import re
rx_sequence=re.compile(r"^(\d+:\s*\(\*\s*T.+)(?:\n?)((?:(?:\n|\r\n?).+)+)", re.MULTILINE)
text="""
2:(* Test #1 :: trj6tkjtkjty7ry7kyrukjkuy*)
rtjtyjtryjtrkjyryukryukrkuy
test3test3test3test3test3test3+1;
3:(* Test3:: test3test3test3test3test3 *)
Twwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwing test69test69';
tyjtdyjtdyjnrdtyntrdyntyntyn
69:(* Ttest69test69:test69test69 *)
(*test69test69test69test69test69test69test69test69test69test6940: (* Finish Test case *)
bTestDone := TRUE;
40: (* Finish Test case *)
bTestDone := TRUE;
END_CASE;
END_CASE;
(**********test10test10test10test10test10**************************)
10: (* Test10test10test10test10test10test10test10test10test10test10test10 *)
test10[test10] := 'test10';
(* petest10test10test10test10test10test10test10test10 *)
btest10test10e := TRUE;
(* Run Sih';io0;'ioh;ui;oi;io;io;anageState OF
"""
for match in rx_sequence.finditer(text):
title, sequence = match.groups()
title = title.strip()
print ("Title:\n",title)
print ("\nSequence===========================================================================================:",sequence)
print ("\n\n")
My regex isn't matching some of the body of case 69, and the last line of case 10. I've been trying to come up with a regex that matches everything but no luck... I'm not sure what to do next.