Hoping you can help. Pretty new to regex and although I have written this regex it doesnt seem to match. I dont recieve an error message so im assuming the syntax is correct but its just not being applied?
I want the regex to replace content like
{foo}bar{/foo} with bar
Here is my code:
$regex = "#([{].*?[}])(.*?)([{]/.*?[}])#e";
$return = preg_replace($regex,"('$2')",$return);
Hope someone can help. Not sure why it doesnt seem to work.
Thanks for reading.