You don't need to escape the # like you don't need to escape it in strings either:
print $1 if 'background-color:#fe34e5' =~ /background-color:\s*#([0-9a-fA-F]{6});*/ig yields
fe34e5
By the way:
;* is a no-op in your regex, so you colud as well leave it out.
Hope this helped.
CombatSquirrel.
Entropy is the tendency of everything going to hell.