Last Updated: February 25, 2016
·
2.018K
· bigbluehat

Convert shorthand hex colors to longhand using regex

Litmus.com recommends using longhand hex colors instead of shorthand ones. So here's some regex to do that en mass:

\#(\w)(\w)(\w)(["|;])

Replace that with:

#\1\1\2\2\3\3\4