Here is what I need to be able to do:
I need to match the following tag:
text sample
For the basic example that you've given.
text sample';
$pattern = '/(.+?)<\/SPAN>/';
$replacement = '$1'
echo preg_replace($pattern,$replacement,$string);
?>
will do the trick. The pattern regex is quite easy - it's exactly what you're looking for (with quotes and '/' escaped) with a (.+?) which says to include all possible characters until the close of the SPAN tag. This assumes that you're code is consistently formatted, you could append a 'i' to the end of $pattern to make it case-insensitive.
Note that this isn't really the right way of doing it.