Match a CSS hex colour like #1e3a8a or #fff. It always starts with # followed by exactly 3 or 6 hex digits.
A intermediate exercise. Your pattern is run against every test case — the strings it must match and the strings it must not — and each one reports what it got against what was expected, with 4 hints if you want them.
A guided tutorial, a live playground, graded exercises checked against test cases, a printable cheatsheet and a glossary. The tool needs JavaScript, because the regular expressions run in your browser.