$re = '/• (.+?)\s+- FF([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})/mi';
$str = ' • White - FFe4e4e4
• Light Gray - FFa0a7a7
• Dark Gray - FF414141
• Black - FF181414
• Red - FF9e2b27
• Orange - FFea7e35
• Yellow - FFc2b51c
• Lime Green - FF39ba2e
• Green - FF364b18
• Light Blue - FF6387d2
• Cyan - FF267191
• Blue - FF253193
• Purple - FF7e34bf
• Magenta - FFbe49c9
• Pink - FFd98199
• Brown - FF56331c';
$subst = "\"$1\": [0x$2, 0x$3, 0x$4],";
$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