Recall & Review
beginner
What does the regex pattern
\d match?It matches any single digit from 0 to 9.
Click to reveal answer
beginner
What is the purpose of the regex pattern
\w+?It matches one or more word characters (letters, digits, or underscore).
Click to reveal answer
beginner
Explain the regex pattern
^abc$.It matches the exact string 'abc' only, from start (^) to end ($) of the line.
Click to reveal answer
beginner
What does the regex pattern
\s* match?It matches zero or more whitespace characters (spaces, tabs, newlines).
Click to reveal answer
beginner
How does the regex pattern
[a-zA-Z] work?It matches any single letter from a to z or A to Z (case sensitive).
Click to reveal answer
Which regex pattern matches a string that starts with 'cat'?
✗ Incorrect
The caret (^) means the start of the string, so '^cat' matches strings starting with 'cat'.
What does the regex pattern
\D match?✗ Incorrect
\D matches any character that is NOT a digit.Which pattern matches one or more digits in a row?
✗ Incorrect
\d+ matches one or more digits consecutively.What does
[0-9a-fA-F] match?✗ Incorrect
It matches any hexadecimal digit: digits 0-9 and letters a-f or A-F.
Which regex matches zero or more whitespace characters?
✗ Incorrect
\s* matches zero or more whitespace characters.List and explain three common regex patterns used to match digits, words, and whitespace.
Think about shortcuts for digits, letters, and spaces.
You got /3 concepts.
Describe how anchors like ^ and $ are used in regex patterns.
Anchors fix where the pattern should appear in the text.
You got /3 concepts.