Recall & Review
beginner
What is regex in simple terms?
Regex, or regular expression, is a way to describe patterns in text. It helps find or match specific text shapes, like words or numbers, inside bigger text.
Click to reveal answer
beginner
How does regex help in pattern matching?
Regex uses special symbols to define rules for text patterns. This lets scripts quickly check if text fits those rules, like finding all emails or phone numbers.
Click to reveal answer
beginner
What does the dot (.) symbol mean in regex?
The dot (.) matches any single character except a new line. It’s like a wildcard for one character in the pattern.
Click to reveal answer
beginner
Why is regex useful in bash scripting?
In bash, regex helps automate tasks by quickly finding or checking text patterns in files or input, saving time and avoiding manual searching.
Click to reveal answer
intermediate
Give an example of a simple regex pattern and what it matches.
The pattern '^a.*z$' matches any text that starts with 'a' and ends with 'z', with any characters in between.
Click to reveal answer
What does regex stand for?
✗ Incorrect
Regex stands for Regular Expression, a tool to describe text patterns.
In regex, what does the '*' symbol do?
✗ Incorrect
The '*' means match zero or more of the character before it.
Which regex symbol matches any single character except a new line?
✗ Incorrect
The dot (.) matches any single character except a new line.
Why is regex useful in bash scripting?
✗ Incorrect
Regex helps automate finding and matching text patterns in bash scripts.
What does the regex pattern '^a.*z$' match?
✗ Incorrect
The pattern matches text that starts with 'a' and ends with 'z'.
Explain in your own words why regex enables pattern matching.
Think about how regex uses symbols to find text shapes.
You got /4 concepts.
Describe a simple regex pattern you might use in bash and what it matches.
Try to use ^, $, or . in your example.
You got /4 concepts.