Match CSS hex colors.
Section: Validation Recipes
Hex color
regex
regex
^#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$Explanation
Covers 3, 6, and 8 digit forms.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Validation Recipes