My current regex is /[$]([a-zA-Z0-9_\-\,:]*)[$]/
and this will allow me to replace strings like the following for our CMS:
$ContentArea1$
$blog:PostTitle$
However when we have content which has prices in dollars preg_replace
gets rid of the first part of the price e.g. $15 $1 $2 etc
How can I make preg_replace
ignore prices within the content?
<?
$message = 'Below is an example for the content replacement<br/><br/><br/>$ContentArea1$';
$newMessage = '<h2>Website Coming soon</h2>
<p>
Are new website will be online soon.</p>
<p>
Price: $2.50</p>
<h2>
Twitter Feed</h2>
';
echo preg_replace('/[$]ContentArea1[$]/',$newMessage,$message);
?>