Test, validate and match regular expressions
Validates color strings in two formats: hex notation like #ff0000 or shorthand #f00, with capture groups for each channel pair, or comma-separated RGB values (0-255) optionally wrapped in parentheses, such as 255, 0, 128 or (10,20,30,40) with an optional fourth alpha-like component. Capture groups allow extracting the red, green, and blue channels from either format. Commonly used for validating and parsing user-supplied CSS-style color input.