COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In regular expressions, the operator ‘*’ stands for?
A
Concatenation
B
Selection
C
Addition
D
Iteration
Explanation: 

Detailed explanation-1: -1 Answer. Easiest explanation: It indicates iterations which can vary from zero to any number.

Detailed explanation-2: -The Match-zero-or-more Operator ( * ) This operator repeats the smallest possible preceding regular expression as many times as necessary (including zero) to match the pattern. ‘*’ represents this operator. For example, ‘o*’ matches any string made up of zero or more ‘o’ s.

Detailed explanation-3: -Each of them are quantifiers, the star quantifier( * ) means that the preceding expression can match zero or more times it is like 0, while the plus quantifier( + ) indicate that the preceding expression MUST match at least one time or multiple times and it is the same as 1, .

Detailed explanation-4: -Operators used in regular expressions include: Union: If R1 and R2 are regular expressions, then R1 | R2 (also written as R1 U R2 or R1 + R2) is also a regular expression. L(R1|R2) = L(R1) U L(R2). Concatenation: If R1 and R2 are regular expressions, then R1R2 (also written as R1.

Detailed explanation-5: -In regular expressions, asterisk (*) means “match zero or more of the preceding character.” To make a “wildcard” (that is, an expression that matches anything) with regular expressions, you must use ‘. *’ (dot asterisk). This expression means, “match zero or more of any character.”

There is 1 question to complete.