Regular Language

2 min read Last updated Tue Jun 09 2026 19:59:41 GMT+0000 (Coordinated Universal Time)

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: 1101*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:
    • (pq)(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)abca|b*c
  • ((0(1))0)((0(1*))|0)01001*|0

Equivalence of Regular Expressions

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

Examples:

  • 1(1Λ)=11*(1|Λ) = 1*
  • 11=11*1* = 1*
  • 01(01)0* | 1* ≠ (0|1)*
  • (01)=(01)(0*1*)* = (0|1)*
Was this helpful?