in reply to How can I extract the expression between two key words

You'd probably want to use a regular expression .. Look into perlre for more info, but this should get you started:
my ($match) = $text =~ /^0(.+)SUBCASE/;
Where $text is the text entered above.