Test, validate and match regular expressions
This regular expression matches hexadecimal color strings, optionally prefixed with a hash symbol (#). It supports both shorthand three-digit and standard six-digit formats. The pattern allows for leading and trailing whitespace and, with the case-insensitive flag, accepts both uppercase and lowercase letters A through F. It is commonly used for validating color inputs in web forms or parsing style sheets.