content between editable regions
Posted: Fri Sep 09, 2005 7:32 am
I was using a regex to capture all the content of a page between the title tags and the body tags
which was:
But then I needed to start being a bit more selective so I added editable regions to the template file but I'm having a bit of trouble with the modified regex:
As you can see there are two regions I need to snatch the content from, but at the moment it doesn't get anything. Is it because there are spaces within the template tags? Or should I use more metacharacters and not try to be so literal? 
which was:
Code: Select all
preg_match("/<title>(.*?)<\/title>.*?<body>(.*?)<\/body>/mis",$filetext, $matches);Code: Select all
preg_match("/<!-- TemplateBeginEditable name=\"title\" -->(.*?)<!-- TemplateEndEditable -->.*?<!-- TemplateBeginEditable name=\"content\" -->(.*?)<!-- TemplateEndEditable -->/mis",$filetext, $matches);