use strict;
my $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';
my $regex = qr/• (.+?)\s+- FF([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})/mip;
my $subst = '"$1": [0x$2, 0x$3, 0x$4],';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
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 Perl, please visit: http://perldoc.perl.org/perlre.html