Match everything between two variables in a given string

So let's say I have these given variables:

string $header = "start";
string $footer = "end";

string $sentance = "start a bunch of text end"; 

I'm trying to match everything between the $header and $footer variables in the $sentance string. I've been scouring the web trying to find an answer to no avail.
Any help is appreciated, thanks! 

use the regular expression:

$header+".*"+$footer

Then substring

ahh perfect... thanks a bunch!

in mel

substitute "bar hum hum foo" "s/bar(.*)foo/$1/";

in python

import re
re.match("bar(.*)foo","bar hum hum foo").group(1)

now python also knows to be not greedy with

re.match("bar(.*?)foo","bar hum hum foo hum hum foo").group(1)