- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the properties of Regular expressions in TOC?
A regular expression is basically a shorthand way of showing how a regular language is built from the base set of regular languages.
The symbols are identical which are used to construct the languages, and any given expression that has a language closely associated with it.
For each regular expression E, there is a regular language L(E).
There are some general equalities for the regular expressions.
All the properties held for any regular expressions R, E, F and can be verified by using properties of languages and sets.
Additive (+) properties
The additive properties of regular expressions are as follows −
R + E = E + R R + ∅ = ∅ + R = R R + R = R (R + E) + F = R + (E + F)
Product (·) properties
The product properties of regular expressions are as follows −
R∅ = ∅R = ∅ R∧ = ∧R = R (RE)F = R(EF)
The distributive properties of regular expressions are as follows −
R(E + F) = RE + RF (R + E)F = RF + EF
The closure properties of regular expressions are as follows −
∅* = ∧ * = ∧ R* = R*R* = (R*)* = R + R* R* = ∧ + RR* = (∧ + R)R* RR* = R*R R(ER)* = (RE)*R (R + E)* = (R*E*)* = (R* + E*)* = R*(ER*)*
All the properties can be verified by using the properties of languages and sets.
(∅ + a + b)* = a*(ba*)*
Using the properties above: (∅ + a + b)* = (a + b)* (+ property) = a*(ba*)* (closure property).
∧ + ab + abab(ab)* = (ab)*
Using the properties above: ∧ + ab + abab(ab)* = ∧ + ab(∧ + ab(ab)*) = ∧ + ab((ab)*) (using R* = ∧ + RR*) = ∧ + ab(ab)*= (ab)* (using R* = ∧ + RR* again)