Computing - Regular Expressions

AQA Computer Science 2022


Reading a regular expression from its state machine

What regular expression is this?

\[ab\]

What regular expression is this?

\[a \vert b\]

What regular expression is this?

\[a+\]

What regular expression is this?

\[a*\]

Drawing the state machine for a regular expression

Visualise the finite state machine for $ab$?

Visualise the finite state machine for $a \vert b$?

Visualise the finite state machine for $a+$?

Visualise the finite state machine for $a*$?

Operator precedence

What is the precedence for regular expressions?

  • ()
  • *
  • +
  • ?
  • |