Greetings.
I have some problems using a Regex replace for converting the following BBCode:
string bbCode = " [ color=red]Red[/color]";
Regex regExp = new Regex(@"\[ color=([^\]]+)\]([^\]]+)\[\/color\]");
string htmlCode = regExp.Replace(bbCode, "<span style=\'color: $1\'>$2</span>');
Essentially, that works well, however, the actual BBCode contains an annoying ":123abc" after the color name:
string bbCode = "[ color=red:123abc]Red[ /color:123abc]";
It can be any type of alphanumeric characters after the colon.
(Sorry, I had to put some spaces after the left brackets, in order to make it post correctly here.)
So, the question is: How do I strip out everything, and including the colon?
Thanks,
Regards,
M