logo

Question detail

Which pair of strings are both recognised by the regular expression colou?r?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Regular languages

Exam-style question

Try this first

Which pair of strings are both recognised by the regular expression colou?r?.

  1. A.color and colour
  2. B.colouur and colour
  3. C.colo and colour
  4. D.color and colouur

Model answer

What a good answer should say

  • color and colour

Explanation

Why this works

The ? means that the preceding character, u, occurs zero or one time.

Therefore, both color and colour are recognised.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.