CMSC330 Quiz 10/01

CMSC 330 — Fall 2026 · October 01, 2026 · 178 players · Max 10 pts

Questions & Results

Q1 of 10Multiple ChoiceAccuracy45s · 1 pt

Which string is fully matched by the regex (a|b)*c ?

A cab
12
B abbac
145
✓ Correct
C abcc
6
D ba
2
165 / 178 answered · 88% correct
Q2 of 10Multiple ChoiceAccuracy45s · 1 pt

What does the regex ab* match?

A Any string of a's and b's
3
B Zero or more copies of ab
4
C An a followed by zero or more b's
165
✓ Correct
D Either a or zero or more b's
172 / 178 answered · 96% correct
Q3 of 10Multiple ChoiceAccuracy60s · 1 pt

Which regex describes exactly the strings over {a, b} with EVEN length?

A (aa|bb)*
8
B (a|b)*(a|b)*
6
C ((a|b)(a|b))*
161
✓ Correct
D a*b*
175 / 178 answered · 92% correct
Q4 of 10Multiple ChoiceAccuracy45s · 1 pt

Which string is NOT in the language of a*b* ?

A abbb
B ba
171
✓ Correct
C aaa
1
D "" (the empty string)
2
174 / 178 answered · 98% correct
Q5 of 10Multiple ChoiceAccuracy45s · 1 pt

Which regex is equivalent to a+ ?

A a?
B a*a*
6
C a|aa
2
D aa*
168
✓ Correct
176 / 178 answered · 95% correct
Q6 of 10Multiple ChoiceAccuracy60s · 1 pt

Which string is matched by ^[0-9]{3}-[0-9]{4}$ ?

A 555-1234
171
✓ Correct
B 55-12345
2
C 5551234
1
D 555-12345
1
175 / 178 answered · 98% correct
Q7 of 10Multiple ChoiceAccuracy60s · 1 pt

Which regex describes exactly the strings over {0, 1} that contain 11 as a substring?

A (0|1)*11(0|1)*
170
✓ Correct
B (11)*
1
C 0*110*
5
D (0|1)*1(0|1)*1
176 / 178 answered · 97% correct
Q8 of 10Multiple ChoiceAccuracy60s · 1 pt

The regex ([a-z]+)@([a-z]+).com is matched against alice@umd.com. What does capture group 2 contain?

A alice
5
B umd
169
✓ Correct
C alice@umd.com
2
D com
2
178 / 178 answered · 95% correct
Q9 of 10Multiple ChoiceAccuracy60s · 1 pt

What substring does a.*b match in the string axbyb ?

A ab
4
B axb
52
C xby
8
D axbyb
112
✓ Correct
176 / 178 answered · 64% correct
Q10 of 10Multiple ChoiceAccuracy60s · 1 pt

Which language CANNOT be described by any regular expression?

A { aⁿbⁿ | n ≥ 0 }
144
✓ Correct
B Strings over {a, b} of length at most 3
10
C Strings over {a, b} that end in ab
3
D Strings over {a, b} with an even number of a's
21
178 / 178 answered · 81% correct

Score Distribution

2
2
1
2
12
23
82
54
0
1
2
3
4
5
6
7
8
9
10

Score (points) →

Players
178
Average Score
8.9
High Score
11
Max Possible
10