1.

Which of the following symbol is used for matching the immediately preceding character?(a) *(b) $(c) [ ](d) %I had been asked this question during an interview.My question is based upon grep command in chapter Filters using Regular Expressions of Unix

Answer»

The correct answer is (a) *

To explain: The asterisk (*) refers to the immediately preceding CHARACTER. It can match the previous character which can OCCUR any number of TIMES or not at all. For EXAMPLE, g* can match a null STRING along with g, gg, ggg, gggg and so on.



Discussion

No Comment Found

Related InterviewSolutions