- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Regular expression is the language which is used to describe the language and is accepted by finite automata. Regular expressions are the most effective way to represent any language. Let Σ be an alphabet which denotes the input set.

The regular expression over Σ can be defined as follows −

- Φ is a regular expression which denotes the empty set.
- ε is a regular expression and denotes the set { ε} and it is called a null string.
- For each ‘a’ in Σ ‘a’ is a regular expression and denotes the set {a}.
- If r and s regular expressions denoting the language.
- L1 and l2 respectively then,
- r+s is equivalent to L1 U L2 union
- rs is equivalent to L1L2 concatenation
- r* is equivalent to L1* closure

The r* is known as Kleen closure or closure which indicates occurrence of r for an infinite number of times.

Some of the **regular expressions and their meanings** are as follows −

**(a+b)***

Meaning − Set of strings of a’s and b’s of any length including the NULL string.

**(a+b)*abb**

Meaning − Set of strings of a’s and b’s ending with string abb.

**ab(a+b)***

Meaning − Set of strings of a’s and b’s starting with string ab.

**(a+b)*aa(a+b)***

Meaning − Set of strings of a’s and b’s having a substring aa.

**a*b*c***

Meaning − Set of strings consisting of any number of a’s followed by any number of b’s followed by any number of c’s.

**aa*bb*cc***

Meaning − Set of strings consisting of at least one a’s followed by string consisting of at least one b’s followed by string consisting at least one c.

**(a+b)*(a+bb)**

Meaning − Set of strings of a’s and b’s ending with either a or bb.

**(aa)*(bb)*b**

Meaning − Set of strings consisting of an even number of a’s followed by an odd number of b’s.

**(0+1)*000**

Meaning − Set of strings of 0’s and 1’s ending with three consecutive zero’s.

**(11)***

Meaning− Set consisting of an even number of 1’s.

- Related Questions & Answers
- Explain the problems for equivalence of two regular expressions.
- What are some basic examples of Python Regular Expressions?
- Explain the concept of Regular expression.
- Explain quantifiers in Java regular expressions
- Explain about regular expressions in TOC?
- Explain the Metacharacter "\B" in Java Regular Expressions.
- Explain the sub-expression "[...]" in Java Regular expressions
- Getting the list of all the matches Java regular expressions
- What are the properties of Regular expressions in TOC?
- Prove the equalities of regular expressions by applying properties?
- Explain character classes in Java regular expressions
- Explain some of the basic types of chemical Reaction?
- Explain the Star Height of Regular Expression and Regular Language
- Explain the evaluation of expressions of stacks in C language
- Explain the conversions of expressions of stacks in C language

Advertisements