Ok, so I have this:
$fromArray = array(
"/(\[color=)(.+)(\])/",
"(\[\/color\])");
$toArray = array(
"<span style=\"color:\\2\">",
"</span>");
What that's supposed to do it match all [color= to .
I'm running that, but this is what the source outputs:
<span style="color:red]RED<b>BOLD</b>RED[/color">
When I try to run
[color=red]RED[b]BOLD[/b]RED[/color]
through it.
What's going on? I don't know Regex very well, this is my first Regex. But I just can't figure out why it's creating that ugly source code that doesn't work :(
Does anybody know?
Thank you :)
**In case somebody has NO IDEA what I want to do with that (it's pretty unclear :), here's it:
Translate [color=red] to<span style="color:red;">
Translate [/color] to </span>
.
Now I need to do these separately, if I do them as one regex pattern it'll mess up with another issue that would take days to explain :\