Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Test  >  Compiler Design  >  Test: Regular Expression - Computer Science Engineering (CSE) MCQ

Regular Expression - GATE CSE (CSE) Compiler Design Free MCQ Test


MCQ Practice Test & Solutions: Test: Regular Expression (15 Questions)

You can prepare effectively for Computer Science Engineering (CSE) Compiler Design with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Regular Expression". These 15 questions have been designed by the experts with the latest curriculum of Computer Science Engineering (CSE) 2026, to help you master the concept.

Test Highlights:

  • - Format: Multiple Choice Questions (MCQ)
  • - Duration: 15 minutes
  • - Number of Questions: 15

Sign up on EduRev for free to attempt this test and track your preparation progress.

Test: Regular Expression - Question 1

A regular expression enables a quick test to determine objects and text strings with undependable values.

Detailed Solution: Question 1

Explanation: Because it checks for all the values and determines whether the output string matches with the given string.

Test: Regular Expression - Question 2

RE can be used only for values of type string and number.

Detailed Solution: Question 2

 No not for all values the string and numbers can we use the RE.

Test: Regular Expression - Question 3

You can use RE, if you expect the value of a property to change in an unpredictable way each time its run.

Detailed Solution: Question 3

Explanation: For every cycle the values does not change unpredictably because the type of grammar that it accepts is defined.

Test: Regular Expression - Question 4

All ___________ Are automatically treated as regular expressions.

Detailed Solution: Question 4

Explanation: The programmatic description is genuinely treated as regular expression.

Test: Regular Expression - Question 5

If a ‘/’ is used before a character that has no special meaning, ‘/’ is ignored.

Detailed Solution: Question 5

Explanation: The backslash carries no significance and it is ignored.

Test: Regular Expression - Question 6

The regular expression denote a language comprising all possible strings of even length over the alphabet (0, 1)

Detailed Solution: Question 6

Explanation: Option A does not consider even length criteria for the question.
Option B it can so happen here that from the former bracket it takes 0 or 1 and takes null from the latter then it forms a string of odd length
Option C it gives either 1 or 0.
Hence Option D is the answer.

Test: Regular Expression - Question 7

The RE gives none or many instances of an x or y is

Detailed Solution: Question 7

Explanation: Whether x or y is denoted by x+y and for zero or more instances it is denoted but (x+y)*.

Test: Regular Expression - Question 8

The RE in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is

Detailed Solution: Question 8

Explanation: The order for the desired string is 012 and foe any number of 0s we write 0* for any number of 1s we denote it by 1* and similarly for 2*.Thus 0*1*2*.

Test: Regular Expression - Question 9

The regular expression have all strings of 0′s and 1′s with no two consecutive 0′s is :

Detailed Solution: Question 9

From the former bracket we choose 0 or epsilon. Then from the latter part 1 or 10 which can be followed by 1 or 10.

Test: Regular Expression - Question 10

The regular expression with all strings of 0′s and 1′s with at least two consecutive 0′s is:

Detailed Solution: Question 10

Explanation: The expression (0+1)*00(0+1)* is where either it initially takes 0 or 1 or 00 followed by string of combination of 0 and 1.

Test: Regular Expression - Question 11

 Which of the following is NOT the set of regular expression R = (ab + abb)* bbab

Test: Regular Expression - Question 12

String generated byS->aS/bA,A->d/ccA

Detailed Solution: Question 12

Explanation: S->aS (substitute S->aS)
S->aaS (substitute S->bA)
S->aabA (substitute A->ccA)
S->aabccA (substitute A->d)
S->aabccd.

Test: Regular Expression - Question 13

Consider the productions of the grammar S->AA, A->aa, A->bb. Describe the language specified by this grammar.

Detailed Solution: Question 13

Option A is correct.

Because A → aa | bb, each occurrence of A generates either the string aa or the string bb.

Since S → AA, the string from S is the concatenation of two strings produced by A. The possible derivations are:

If both occurrences of A produce aa: S → AA → aa aa → aaaa.

If the first A produces aa and the second produces bb: S → AA → aa bb → aabb.

If the first A produces bb and the second produces aa: S → AA → bb aa → bbaa.

If both occurrences of A produce bb: S → AA → bb bb → bbbb.

Therefore the language is {aaaa, aabb, bbaa, bbbb}, which matches Option A.

Test: Regular Expression - Question 14

If R is regular language and Q is any language (regular/ non regular), then Pref (Q in R) is _____________

Detailed Solution: Question 14

Explanation: So says the definition of Regular Grammar.

Test: Regular Expression - Question 15

The production of the form non terminal → Λ is said to be null production.

Detailed Solution: Question 15

The productions of type ‘A -> λ’ are called λ productions ( also called lambda productions and null productions) . These productions can only be removed from those grammars that do not generate λ (an empty string). It is possible for a grammar to contain null productions and yet not produce an empty string.

26 videos|92 docs|30 tests
Information about Test: Regular Expression Page
In this test you can find the Exam questions for Test: Regular Expression solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Regular Expression, EduRev gives you an ample number of Online tests for practice
26 videos|92 docs|30 tests
Download as PDF