I have some HTML source like:
Code: Select all
<!--[START]-->This is some HTML content which needs to be replaced dynamically...is it possible?<!--[FINISH]-->
Here is the simple regex I have constructed thus far:
Code: Select all
$regex = '/<!--\[START\]-->(.|\s)+<--\[FINISH\]-->/';
I can keep the regex simple and assume there is NO whitespace between the comments themselves...only the content inbetween START and FINISH may be subject to whitespace or anything else...which is why I'm confused why my regex doesn't work...even remotely. If I remove the proceeding '+' it matches nothing...if I add it...everything goes bye bye.
Can someone please help correct my regex so I can continue with my project.
p.s-I'm using preg_replace
Cheers
