rendezvous123 Posted March 13, 2006 Share Posted March 13, 2006 Here's what i'm having trouble with:[code]$shout = ereg_replace('\\[color="(.*)"\\](.*)\\[/color\\]', '<font color="\\1">\\2</font>', $shout);[/code]When, i test it, it works fine, until, another instance of it is found on the same line.I submit this: [code][color="blue"]text[/color][/code]It brings back this: [code]<font color="blue">text</font>[/code]But, when I submit this: [code][color="blue"]text[/color][color="blue"]text[/color][/code]It brings back this:[code]<font color="blue"]stuff[/color][color="blue">stuff</font>[/code][b]How can i make it to bring back this?:[/b][code]<font color="blue">text</font><font color="blue">text</font>[/code]I've tried many things, but failed to get what i want... Quote Link to comment https://forums.phpfreaks.com/topic/4803-regex-problems/ Share on other sites More sharing options...
rendezvous123 Posted March 13, 2006 Author Share Posted March 13, 2006 Nevermind! I figured out how. I needed to negate a character. All works fine, now. :D Quote Link to comment https://forums.phpfreaks.com/topic/4803-regex-problems/#findComment-16940 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.