1.

The expression a{5} will match _____________ characters with the previous regular expression.(a) 5 or less(b) exactly 5(c) 5 or more(d) exactly 4This question was posed to me in a national level competition.This interesting question is from Regular Expressions in division Regular Expressions and Files of Python

Answer»

The correct choice is (b) EXACTLY 5

The explanation: The character {m} is USED to match exactly m CHARACTERS to the PREVIOUS regular expression. HENCE the expression a{5} will match exactly 5 characters and not less than that.



Discussion

No Comment Found

Related InterviewSolutions