$re = '/(?<=\W)Set(Scale|Blend|Alpha|Rotation|Color)\s*(\(?.+(?:\;|$))/m';
$str = ' SetScale 1,1;
SetBlend alphaBLEND;
SetAlpha 1;
SetRotation 0;
SetColor 255,255,255;
//SetColor 228,33,0
SetColor s.rgb[0],s.rgb[1],s.rgb[2];
SetScale b.MorphNow*2,b.MorphNow*2;
SetAlpha map(b.HP[0],0,b.HP[1],0,1);
SetAlpha - float(n) / Fade1';
$subst = "Set$1 $2";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php