Lesson 4.4.2.3
4.4.2.3 Regular expressions Quiz: AQA Computer Science, Unit 4
20 questions
In partnership with Revision Ninja
Lesson 4.4.2.3, Regular expressions: 20 multiple choice questions for the AQA Computer Science (7517), Unit 4: Theory of computation, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
What is the main purpose of a regular expression?
- Describing string sets
- Storing relational data
- Defining hardware logic
- Executing compiled code
-
What does the metacharacter * represent in a regular expression?
- One or more
- Exactly one
- Zero or more
- Zero or one
-
What does the metacharacter + represent in a regular expression?
- One or more
- Exactly two
- Zero or more
- Zero or one
-
What does the metacharacter ? represent in a regular expression?
- Zero or more
- One or more
- Exactly one
- Zero or one
-
What does the metacharacter | mean in a regular expression?
- Alternation, meaning or
- Concatenation
- Grouping
- Repetition
-
Which of these strings is matched by the regular expression a(a|b)*?
- bb
- ba
- abb
- bba
-
Which string is matched by a(a|b)*?
- aba
- bba
- ba
- b
-
Which string is matched by the regular expression ab+?
- ba
- a
- bb
- abbb
-
Which string is matched by the regular expression colou?r?
- colouurr
- color
- colr
- colouur
-
Which string is matched by (01)*?
- 010
- 0110
- 1010
- 0101
-
Which string is matched by 0(0|1)*0?
- 0111
- 1001
- 0110
- 0101
-
Which regular expression matches one or more a followed by an optional b?
- a*b+
- a|b?
- (ab)+
- a+b?
-
Which string is matched by a(b|c)?
- ab
- a
- b
- abc
-
What is the relationship between regular expressions and finite state machines?
- Equivalent
- Unrelated
- Inverse
- Hierarchical
-
Which set of binary strings forms a regular language?
- Matching nested brackets
- Palindromic sequences
- Equal 0s and 1s
- Ending in 1
-
Why is the language {0^n 1^n | n ≥ 1} not a regular language?
- Has fixed length
- Requires unbounded memory
- Contains binary digits
- Uses multiple symbols
-
In a regular expression, what does the metacharacter * represent?
- One or more
- Zero or one
- Zero or more
- Exactly one
-
Which regular expression matches binary strings containing at least one 1?
- 0*
- (0|1)*1(0|1)*
- 1+0+
- (0|1)*
-
Which string is matched by both a* and (a|b)+?
- ab
- b
- aa
- ba
-
In regular expressions, which metacharacter denotes alternation?
- ?
- +
- |
- *
Related quizzes
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions
- Abstraction Quiz · 4.4.1.3 · 20 questions
- Problem reduction and decomposition Quiz · 4.4.1.8 · 20 questions
- Composition Quiz · 4.4.1.10 · 20 questions
- Automation Quiz · 4.4.1.11 · 20 questions
- Finite state machines Quiz · 4.4.2.1 · 20 questions
- Backus-Naur Form and syntax diagrams Quiz · 4.4.3.1 · 20 questions
- Comparing algorithms Quiz · 4.4.4.1 · 20 questions
- Order of complexity Quiz · 4.4.4.3 · 20 questions
- Limits of computation and computable problems Quiz · 4.4.4.4 · 20 questions