/^/

Lesson 28 of 28

Regex Quiz

A short recap of the whole course, congratulations for finishing, and a pointer to the full scored course quiz.

4 min read

You’ve made it through all 28 lessons — that’s the whole course, start to finish.

Along the way you went from the absolute basics — what a regex even is, and how an engine actually walks through one character at a time — up through literals, character classes, and anchors that pin a match to a specific position. You added quantifiers to control repetition, and learned the crucial difference between greedy and lazy matching. You used groups to capture, group, and label pieces of a match, alternation to offer multiple options, and backreferences to refer back to something already matched. You pushed further into lookahead and lookbehind (positive and negative), learned how and when to escape special characters, and picked up the flags that change how a whole pattern behaves. From there you moved into practical territory: real-world patterns for things like emails, URLs, and dates, how to reason about performance and avoid catastrophic backtracking, and a set of best practices for writing regex that your future self (or a teammate) can actually read. Finally, you worked through interview-style questions, a worked challenge, and a set of standalone exercises tying everything together.

That’s a genuinely complete toolkit. Regex is one of those skills that keeps paying off in small ways forever after this — a quick find-and-replace here, a validation rule there, a one-line log parser instead of a twenty-line script.

The four questions in this lesson’s quiz are a quick spot-check across different parts of the course — character classes, anchors, lookaround, and performance — rather than a deep dive into any one of them. For a longer, properly scored assessment covering everything from lesson 1 through lesson 27, head over to the dedicated quiz page: take the full course quiz.

Congratulations on finishing the course — go build something that would have taken you an afternoon of manual string-fiddling, and enjoy doing it in one line instead.

Quick check

Which shorthand character class matches any non-whitespace character?

What does the pattern ^\d{3}$ match?

In the pattern (?<=\$)\d+, what role does (?<=\$) play?

Which pattern shape is most likely to trigger catastrophic backtracking on a long, non-matching input?