I'm working on this RegEx to match and replace CSS with other CSS values. So far I have this:
$css_new = preg_replace('/('.$definition.'.*?\s'.$property.':)[^;]*([^}]*)/is','$1 '.$value.'$2',$css_temp);
The issue I have is that if I am trying to replace something in the definition ".menu" values also get replaced in the ".menu li" definition.
I was thinking of adding a "{" somewhere but I'm not having luck with it. I tried this:
$css_new = preg_replace('/('.$definition.'{.*?\s'.$property.':)[^;]*([^}]*)/is','$1 '.$value.'$2',$css_temp);
Thanks for your help.