Hi I hope someone can help, as not too hot on regular expressions.
Got a script snippet as follows..
<?php
$news="test message {image=abc} more text text text {image=def}";
$news=preg_replace_callback("/\{image=.*\}/i",function ($matches) { $field=$matches[0]; return "*".$field."*"; }, $news);
echo $news;
?>
However when i run it, it returns
test message *{image=abc} more text text text {image=def}*
Instead I want it to return..
test message *{image=abc}* more text text text *{image=def}*
Thanks for any help.