WorksheetsY13 Regular expressions
Total questions: 14
Worksheet time: 7mins
Select the 2 strings that are matched by the regular expression:
a(bc)*d
abcbcbcbcd
acd
ad
acccd
Select the 2 strings that are matched by the regular expression:
a(b|c)?d
abcbcbcbcd
acd
ad
acccd
Select the string that is NOT matched by the regular expression:
ab?c*d
abcbcbcbcd
acd
ad
acccd
Which regular expression matches the FSM?
a?bc(dc)*
a|b(cd)+
a+bc(dc)?
a(b|c)d*c*
Regular expression are used to...
match patterns in text
draw FSMs
define programming language
correct spellings
Select the strings that match the regular expression
(D|d)is(c|k)
disc
disK
is
DisK
Which regular expression matches the FSM?
ab|cb+
(a|b)+cb*
(a|cb+)+
a?c|b*
Select the 2 strings that match the regular expression
(M|m)o+
Mooo
m
Mmmmm
mo
Symbol used to represent zero or one of the preceding tokens
?
*
^
+
Which symbol Separates alternatives (or, ⋁)
|
*
+
?
()
Which symbol Indicates that there are zero or more of the preceding element i.e. zero or more repetitions
|
*
+
?
()
Which symbol Indicates that there is one or more of the preceding element i.e. one or more repetitions
|
*
+
?
()
Which symbol Indicates that there are zero or one of the preceding element i.e. optional character
|
*
+
?
()
Which symbol is used to identify/capture groupings
|
*
+
?
()
