LEXICAL ANALYSIS
REGULAR EXPRESSIONS AND FINITE AUTOMATA
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
0+01
|
|
{0} U {01}
|
|
{0} U {0}{1}
|
|
{0} ^ {01}
|
Detailed explanation-1: -Which of the following does not represents the given language? Explanation: The given option represents 0, 01 in different forms using set operations and Regular Expressions. The operator like ^, v, etc. are logical operation and they form invalid regular expressions when used.
Detailed explanation-2: -Statement 2: represents the language that consist of no string. Explanation: represents a single string in the set namely, the empty string while Statement 2 is also correct.
Detailed explanation-3: -Every regular expression over 0, 1 is itself a string over the 8-symbol alphabet 0, 1, +, *, (, ), , Ø. regular expression is a base-9 representation of a unique integer. Countably infinite!
Detailed explanation-4: -Regex support is part of the standard library of many programming languages, including Java and Python, and is built into the syntax of others, including Perl and ECMAScript. Implementations of regex functionality is often called a regex engine, and a number of libraries are available for reuse.
Detailed explanation-5: -Which of the following is/are non regular? Explanation: There is no regular expression that can parse HTML documents. Other options are also non-regular as they cannot be drawn into finite automaton.