Skip to content

Regex Patterns Every Developer Should Know Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 120 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What does the regex metacharacter . match by default?

Show ▼

A single character of any kind except the newline character (\n). To make it also match newlines, use the s (dotall / single-line) flag, e.g. /foo.bar/s in JavaScript or re.DOTALL in Python.

Which character class matches any single digit in most regex flavors?

Show ▼

[0-9] or the shorthand \d. \d is equivalent to [0-9] in ASCII; with Unicode (u flag in JS, default in Python 3 str) it matches any Unicode decimal digit, e.g. Arabic-Indic digits.

What does the shorthand \w match?

Show ▼

Any word character. In ASCII mode this is [A-Za-z0-9_]; in Unicode mode it also matches letters and digits from other scripts, and the underscore.

What does the shorthand \s match?

Show ▼

Any whitespace character: space, tab (\t), newline (\n), carriage return (\r), form feed (\f), and vertical tab (\v). In Unicode mode it can also match rare whitespace like the non-breaking space U+00A0.

How do you match a literal dot in a regex?

Show ▼

Escape it with a backslash: \.. Inside a character class the dot is literal even without escaping, but \. still works and is the safe habit.

🎯 Take the Regex Patterns Every Developer Should Know Practice Exam