logo

Learning objective

Regular expressions: Know that a regular expression is simply a way of describing a set and that regular expressions allow particular types of languages to be described in a convenient shorthand notation. For example, the regular expression a(a|b)* generates the set of strings {a, aa, ab, aaa, aab, aba, …}. Be able to form and use simple regular expressions for string manipulation and matching. Students should be familiar with the metacharacters: • * (0 or more repetitions) • + (1 or more repetitions) • ? (0 or 1 repetitions, ie optional) • | (alternation, ie or) • ( ) to group regular expressions. Any other metacharacters used in an exam question will be explained as part of the question. Be able to describe the relationship between regular expressions and FSMs. Regular expressions and FSMs are equivalent ways of defining a regular language. Be able to write a regular expression to recognise the same language as a given FSM and vice versa. A student's ability to write very simple regular expressions and FSMs will be assessed.

Read the explanation, check the common trap, then practise with flashcards and questions.

At a glance

0

Flashcards

0

Questions

Topic

Regular languages

Subtopic

Regular expressions

Aqa A Level Computer ScienceTheory of computation

Study support

Understand this objective

Quick explanation

Regular expressions: Know that a regular expression is simply a way of describing a set and that regular expressions allow particular types of languages to be described in a convenient shorthand notation. For example, the regular expression a(a|b)* generates the set of strings {a, aa, ab, aaa, aab, aba, …}. Be able to form and use simple regular expressions for string manipulation and matching. Students should be familiar with the metacharacters: • * (0 or more repetitions) • + (1 or more repetitions) • ? (0 or 1 repetitions, ie optional) • | (alternation, ie or) • ( ) to group regular expressions. Any other metacharacters used in an exam question will be explained as part of the question. Be able to describe the relationship between regular expressions and FSMs. Regular expressions and FSMs are equivalent ways of defining a regular language. Be able to write a regular expression to recognise the same language as a given FSM and vice versa. A student's ability to write very simple regular expressions and FSMs will be assessed

  • This point belongs to Regular languages, especially Regular expressions.
  • You need to be able to regular expressions: Know that a regular expression is simply a way of describing a set and that regular expressions allow particular types of languages to be described in a convenient shorthand notation. For example, the regular expression a(a|b)* generates the set of strings {a, aa, ab, aaa, aab, aba, …}. Be able to form and use simple regular expressions for string manipulation and matching. Students should be familiar with the metacharacters: • * (0 or more repetitions) • + (1 or more repetitions) • ? (0 or 1 repetitions, ie optional) • | (alternation, ie or) • ( ) to group regular expressions. Any other metacharacters used in an exam question will be explained as part of the question. Be able to describe the relationship between regular expressions and FSMs. Regular expressions and FSMs are equivalent ways of defining a regular language. Be able to write a regular expression to recognise the same language as a given FSM and vice versa. A student's ability to write very simple regular expressions and FSMs will be assessed.
  • Use the linked flashcards and practice questions to check recall, then practise applying the idea in an exam-style answer.

Why it matters

This objective helps connect Regular expressions to exam-style questions, flashcards, and revision notes for Regular languages.

Quick student answer

Which string is generated by the regular expression a(a|b)*?

Direct answer

ababa

Key terms

  • Regular expression: A convenient shorthand way of describing a set of strings, or a regular language.
  • Alternation: The choice between alternatives in a regular expression, represented by the | metacharacter.

Common trap

Misreading the scope of *: Remember that * applies to the immediately preceding regular expression. Use parentheses, such as (a|b)*, when the repetition should apply to a group.

Related questions

Try this as a practice card

4 linked

Question 1 of 4

Choose an answer, get feedback, then move sideways through the set.

0 of 4 attempted

Flashcard prompts

Flip through the key recall cards

4 cards

Flashcard 1 of 4

Press Space to flip, arrows to move

Revision tools

Choose how to practise

Back to topic hub
Flashcards0 linked cards
No objective-specific flashcards are cached for this page. Use the topic hub to revise the surrounding flashcards without triggering a frozen-subject DB fallback.Open topic hub
Practice Questions0 linked questions
No objective-specific practice questions are cached for this page. Use the topic question bank to practise nearby curriculum questions without weakening the egress guard.Open topic questions

Related learning objectives