Describing regular expressions by recursion

Regular expression

A regular expression (over alphabet ) is a string consisting of:

  • symbols from
  • and symbols from .
Link to original

The infinite set of regular expression over is defined recursively as follows:

  • Basis case: , , and each symbol in the alphabet are regular expressions.
  • Recursive step: if and are regular expressions, then so are , , and .

Notational conventions

There are some conventions to follow when working with regular expressions:

  • Outermost brackets are omitted.
  • Brackets are omitted when concatenating expressions. e.g. writing instead of .
  • ‘binds’ take precedence over concatenation e.g. we write instead of