Sift Nenek Marni's harvest sacks with a regex: 18 levels of anchors, character classes, quantifiers and capture groups. 18 levels, right in the browser.
A regular expression (regex) is a pattern for matching text. \d matches one digit, + means 'one or more', and the anchors ^ (start) & $ (end) force the pattern to cover the whole string. Without anchors, the pattern just needs to be found somewhere, and that often lets 'dirty' strings through. Write a pattern that passes every valid example and rejects the rest.
A character class [...] matches ONE character from the set inside, and can combine several ranges: [0-9a-fA-F] = a digit OR a hex letter (lower/upper). Follow it with {6} for exactly six, and a literal # in front. Literals match as-is.
\b is a word boundary: a zero-width position between a word character (\w) and a non-word one. \bcat\b matches a standalone "cat" but NOT part of "category" or "scatter". Without boundaries, the regex catches the substring inside other words.
Parentheses (…) don't just group: they capture the matched text into numbered groups (group 1, 2, 3, …). This is how you extract parts of a string: wrap each piece you want. match() returns those groups in order.
And more, 18 levels in all.