PHP not change color in quotes
I want to change the color of text inside single quotes, but i have also want to change the color of parenthasis as long as they arent in quotes. this is what i have but its not working as planned.
"/([^'])\((.*?)\)([^']+)/is" => "$1<span style=\"color: ".$ccode['green']."\">(</span>$2<span style=\"color: ".$ccode['green']."\">)</span>$3"
Im using preg replace and this is just a part of th开发者_运维知识库e array. any ideas?
I would recommend using one of the fine online regex testers available. A good example of one is at http://www.regextester.com/ More than likely your regex isn't parsing as you expect. Using a visual tester helps pinpoint the problem.
精彩评论