Hexadecimal Color Code Regular Expression

Category: Strings | Views Total: 5 views

A regular expression to parse and validate a hexadecimal color value.

/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/

Hexadecimal Color Code:

  • #ff0000
  • #f00
Rate This Regex
Sending
User Review
0 (0 votes)

Leave a Reply