I've tried this a number of different ways and I've even downloaded the Regular Expression reference sheet from addedbytes.com, but I just can't figure out how to move this eregi_replace() statement into a preg_replace() statement.
I've read and understood the delimiter requirements for preg_replace(), but I think the problem is the modifiers. How to I know which modifier to use for this function? I've tried \A, \b, and \e, but none seem to work. I think there's something simply I'm missing.
$bodytag = '%%BODY%%';
$header = eregi_replace($bodytag . '.*', '', $temp);
$footer = eregi_replace('.*' . $bodytag, '', $temp);
I've tried the following:
$header = preg_replace('/%%BODY%%.*/i', '', $temp);
$footer = preg_replace('/.*%%BODY%%/i', '', $temp);
But it doesn't seem to work. What am I missing?
More recently, I've tried this with no fix.
$bodytag = "%%BODY%%";
$header = preg_replace("/".$bodytag."(.*)/i", '', $temp);
$footer = preg_replace("/(.*)".$bodytag."/i", '', $temp);