Test, validate and match regular expressions
This regular expression matches both 3-digit and 6-digit lowercase hexadecimal color codes, such as #fff or #1a2b3c. It uses a positive lookahead to ensure the match is followed by a non-word character or the end of a line, preventing partial matches inside longer words. It is particularly useful for extracting color values from CSS files or other text documents.