ereg_replace help
Posted: Sun Feb 02, 2003 1:41 pm
Okay, I've always been bad at reg exp's but here is my problem;
I use the code:
so if i type in [ color=red ]something[ /color ] (wihout spaces), it will turn the text red..
but now, if i type [ color=red ] this should be red [ /color ][ color=blue ] this should be blue [ /color ] (without spaces), it all turns out red...
i know i should be changing the (.*) to somethign else, but i just can't grasp what.
I use the code:
Code: Select all
$data = eregi_replace("\їcolor=(ї#a-fA-F0-9]{7}|їa-zA-Z]*)\](.*)\ї/color\]",
"<span style="color:\\1;background-color:transparent">\\2</span>", $data);but now, if i type [ color=red ] this should be red [ /color ][ color=blue ] this should be blue [ /color ] (without spaces), it all turns out red...
i know i should be changing the (.*) to somethign else, but i just can't grasp what.