Exam-style question
Try this first
Which string is generated by the regular expression a(a|b)*?.
- A.ba
- B.ababa
- C.bbb
- D.bbab
Answer and explanation
Concise answer
ababa
Why this is correct
The expression must begin with a. After that, it can contain zero or more occurrences of either a or b, so ababa is generated.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
