1.

Generate the regular expression to match blank lines(a) / */(b) /bl(c) /^?/(d) /^(dollarSign)/The question was asked in an international level competition.Question is taken from Regular Expression in UNIX topic in portion Regular Expressions and Languages of Automata Theory

Answer»

Correct answer is (d) /^$/

The explanation: There are few expressions which provide the utility of MATCHING metacharacters INCLUDING /^$/ for blank lines,/ */ for matching one or more spaces, /^.*$/ for matching an entire LINE whatever it is.



Discussion

No Comment Found

Related InterviewSolutions