The second Regex Tuesday challenge is slightly trickier challenge. Unlike the last challenge, it is to match something, not to replace something.
In this challenge, you are aiming to match a grayscale CSS colour. It should be able to match anything but the colour names (eg "red"). See the test cases below for examples.
To test a regular expression on the test cases below, type it into the text input. Each test case will be marked as passed or failed respectively - you are aiming to get as many test cases as you can to pass. Note that JavaScript must be enabled for this feature to work. The regex engine used is the JavaScript regex engine; it is similar to PCRE, but with a few differences.
If you're finding this challenge too tricky, you can simplify it - for example, to match all the hex colours (eg "#000
"), and then move onto the rgb colours. hsl can be a bit trickier - do as much or as little as you can. For an explanation of the various colour syntaxes available, check out this article. Good luck!