chapter002 Finite State Automata, Rebular Languages, and Regular Expressions
section004Regular Expressions
Constructing Regular Expressions

Constructing Regular Expressions

What are the rules for constructing a regular expression? They are pretty simple.

Example of Regular Expression Construction

Suppose we have the set A = {a, b, c} to work with. Then we use

We also have two other special regular expresssions:

Any expressions we can build up from these base regular expressions with a finite number of applications of the operators

(with the use of parentheses to enforce operation order) are also regular expressions.

So, for example,

and so forth.