At least for getting the result you can use
You can probably use Regex.Matches
and Match.Groups
like e.g.
const string pattern = "(<color=(\"#[a-f0-9]{6}\"|#\"[a-f0-9]{4}\")>(.+)<\/color>)";
string input = "<color=\"#00ff00\">Green<\/color>";
var matches = Regex.Matches(input, pattern);
var stringBuilder = new StringBuilder();
foreach(var match in matches)
{
var groups = match.Groups;
// This will hold the entire matchg group "<color=\"#00ff00\">Green<\/color>"
var entireMatch = groups[0].Value;
// This will hold the color value like "\"#00ffaa\""
var color = groups[1].Value;
// This will hold the text like "Green"
var text = groups[2].Value;
rawText.Append(text);
}
var rawText = stringBuilder.ToString();
This would not be enough to actually validate the input, though.