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|ba — In regular expressions, the Kleene star operator (*) denotes zero or more repetitions of the preceding pattern. Because it allows a pattern to repeat any…
- A.
ab|ba
- B.
(a|b)*
- C.
(ab|ba)*
- 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.
Loading lesson…