# Algebraic Laws for Regular Expressions RegEx

## Algebraic Laws for Regular Expressions RegEx

Let us see the Algebraic Laws for Regular Expressions RegEx.

## Associativity Laws for Regular Expressions RegEx

Let us see the Associativity Laws for Regular Expressions RegEx.

A + (B + C) = (A + B) + C and A.(B.C) = (A.B).C.

## Commutativity for Regular Expressions RegEx

Let us see the Commutativity for Regular Expressions RegEx.

A + B = B + A. However, A.B 6= B.A in general.

## Identity for Regular Expressions RegEx

Let us see the Identity for Regular Expressions RegEx.

∅ + A = A + ∅ = A and ε.A = A.ε = A

## Annihilator for Regular Expressions RegEx

Let us see the Annihilator for Regular Expressions RegEx.

∅.A = A.∅ = ∅

## Distributivity for Regular Expressions RegEx

Let us see the Distributivity for Regular Expressions RegEx.

Left distributivity:  A.(B + C) = A.B + A.C.

Right distributivity:  (B + C).A = B.A + C.A.
Idempotent A + A = A.

## Closure Laws for Regular Expressions RegEx

Let us see the Closure Laws for Regular Expressions RegEx.

.

(A*)* = A*, ∅* = ε, ε* = ε, A+ = AA* = A*A, and A* = A + + ε.

## DeMorgan Type Law for Regular Expressions RegEx

Let us see the DeMorgan Type Law for Regular Expressions RegEx.

(L + B)* = (L*B*)*