2011-04-05, 16:24:41
RobA Wrote:Though regexping wold be a bit tricker as it would require preg_quote.... so your example from a plugin could be:
Code:$tmpContent = preg_replace('/'.preg_quote(GSPLUGINTAGSTART).'(.*)googlemap(.*)'.preg_quote(GSPLUGINTAGEND ).'/i',$div,$tmpContent);
-Rob A>
Not only that - the end tag might be legally embedded within the tag, thus it is nearly impossible to make the tags configurable e.g.
Code:
(% myplugin percentindicator="(%)" %)
BTW: the googlemap regular expression shown above is really bad and should rather be something like:
Code:
'/\(%(\s*)googlemap(.*?)\s*%\)/i'
otherwise it can not coexist with other similar plugins and match the following texts, too:
Code:
(% mybettergooglemap %)
Code:
(% googlemap %) some text (% searchform %) (% searchresults %)