$x = '[color=blue:2cd68fd71f] and [/color:2cd68fd71f]';
$pattern = '#\[[^\]]+\]#';
$x = preg_replace($pattern, '', $x);
// now $x has this value: ' and ';
Replaces "[any_character]" with an empty string.
Experiment with different inputs; maybe you'll need a more specific pattern.
Also, depending on the format of the file, maybe some parser would be appropriate. Regex tends to produce chaos.
For example:
// for this input:
[color=blue:2cd68fd71f] [sdfsdf]and [/color:2cd68fd71f]
//... the above script will output:
' and '