Which of the following regular expressions DOES NOT generate an infinite…

2025

Which of the following regular expressions DOES NOT generate an infinite language?

Answer: A. ab|baIn regular expressions, the Kleene star operator (*) denotes zero or more repetitions of the preceding pattern. Because it allows a pattern to repeat any…

  1. A.

    ab|ba

  2. B.

    (a|b)*

  3. C.

    (ab|ba)*

  4. D.

    a*

Attempted by 157 students.

Show answer & explanation

Correct answer: A

In regular expressions, the Kleene star operator (*) denotes zero or more repetitions of the preceding pattern. Because it allows a pattern to repeat any arbitrary number of times (0, 1, 2,.,....∞), the presence of a Kleene star on a non-empty symbol or pattern almost always creates an infinite language.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…