Regular Language

Simplest class of languages in the Chomsky hierarchy.

Built from basic languages using simple operations:

  • Union
  • Concatenation
  • Kleene star

Using only concatenation gives single-string languages. Union and * allow infinite languages.

Regular Expression

A regular expression is a symbolic representation of a regular language. Every regular language has a regular expression.

A regular expression describes the typical form of strings in the language.

Example: 1∗101*10 means any number of 11s followed by 1010.

Notation Rules

  • { } are removed or replaced by ( )
  • Union ∪\cup is written as ∣|
  • ab means they are concatenated.

Recursive Definition of Regular Expression

Let Σ\Sigma be an alphabet.

Regular expressions are defined as follows:

  1. ∅\varnothing is a regular expression and denotes ∅\varnothing
  2. λ\lambda is a regular expression and denotes { λ }\set{\lambda}
  3. For each a∈Σa \in \Sigma, aa is a regular expression denoting { a }\set{a}
  4. If pp and qq are regular expressions:
    • (p∣q)(p | q) denotes union
    • (pq)(pq) denotes concatenation
    • (p∗)(p*) denotes Kleene star

Only expressions formed using these rules are valid.

Operator Precedence

To reduce parentheses:

  • ∗* has highest precedence
  • Concatenation has next highest
  • ∣| has lowest precedence

Examples:

  • a∣((b∗)c)a|((b*)c) → a∣b∗ca|b*c
  • ((0(1∗))∣0)((0(1*))|0) → 01∗∣001*|0

Equivalence of Regular Expressions

2 regular expressions are equal iff they denote the same language.

Examples:

  • 1∗(1∣Λ)=1∗1*(1|Λ) = 1*
  • 1∗1∗=1∗1*1* = 1*
  • 0∗∣1∗≠(0∣1)∗0* | 1* ≠ (0|1)*
  • (0∗1∗)∗=(0∣1)∗(0*1*)* = (0|1)*
Written by October 7, 2026 2 min read
Was this helpful?