Regular Expression - Examples

Share

Summary

This video provides examples of how to describe given sets as regular expressions, illustrating the use of 'or' (plus symbol), handling empty symbols, and differentiating between closure and positive closure.

Highlights

Example 1: Set with multiple symbols (0, 1, 2)
00:00:32

The first example shows a set containing the symbols 0, 1, and 2. The regular expression for this set is R = 0 + 1 + 2, where the plus symbol denotes 'or'.

Introduction to Regular Expressions from Sets
00:00:00

The video starts by explaining that it will demonstrate how to form regular expressions from given sets, providing examples of five different sets to describe.

Example 2: Set with empty symbol and a string (AB)
00:01:14

The second example involves a set with an empty symbol and the string 'AB'. The regular expression is R = εAB, where the empty symbol and AB are written directly without an 'or' symbol since there's only one non-empty string.

Example 3: Set with multiple strings (ABB, A, B, BBA)
00:02:04

The third example demonstrates a set with multiple strings: ABB, A, B, and BBA. The regular expression uses the 'or' symbol: R = ABB + A + B + BBA.

Example 4: Closure of a symbol (0)
00:02:53

The fourth example presents a set including the empty symbol and any number of zeros (ε, 0, 00, 000,...). This represents the closure of zero, denoted as R = 0* (zero with a star superscript).

Example 5: Positive Closure of a symbol (empty symbol excluded)
00:04:01

The final example shows a set with any number of ones, but without the empty symbol (1, 11, 111,...). This is a positive closure, denoted as R = 1+ (one with a plus superscript), indicating that the empty symbol is not included.

Recently Summarized Articles

Loading...