4

Regular Expression

4.1 BASICS OF REGULAR EXPRESSION

Q. What is Regular Expression?

Ans. A regular expression can be defined as a language or string accepted by a finite automata.

We know that a finite automata consists of five touples {Q, Σ, δ, q0, F}. Among them a Regular Expression is a string on Σ, i.e. it will consist only with input alphabets.

In short a Regular Expression is written as RE.

Q. Give some formal recursive definition of Regular Expression

Ans.

(i) Any terminals, i.e. the symbols belong to Σ are Regular Expression. Null string(Λ) and Null set(Φ) are also Regular Expression.

(ii) If P and Q are two Regular Expressions then the union of the two Regular Expressions denoted by P + Q is also a Regular Expression.

(iii) If P

Get Express Learning: Automata Theory and Formal Languages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.