logo

AQA A-Level Computer Science practice

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

Try the question first, then check the answer and practise the same topic again.

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

Answer and explanation

Concise answer

color and colour

Why this is correct

The ? means that the preceding character, u, occurs zero or one time. Therefore, both color and colour are recognised.

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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions