I am having some difficulties in trying to write php regex expression using preg_match_all.
I’m trying to match the {php}
and {/php}
within the following example:
{php}
some php code
{/php}
{php}
some more php code block
{/php}
I have managed to get as far as matching the {php}
by using the following {\s*php\s*}(.*?)
and testing using this site: https://www.phpliveregex.com/#tab-preg-match-all
as soon as I try the following {\s*php\s*}(.*?){\s*/php\s*}
I don’t get any matches the only difference that I have done to the above is add the following at the end: {\s*/php\s*}
thank you for your help.