You may be looking for something like this:
$code= 'Some text with [COLOR="red"]colored text[/COLOR] and [SIZE="7"]Big fonts[/SIZE] while "This double quote" is not matched';
preg_match_all('/\[.*?="(\w+)"\]/', $code, $matches, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($matches[1]); $i++) {
echo $matches[1][$i]."\n";
}