1.

What does /[^(]* regular expression indicate?(a) Match one or more characters that are not open parenthesis(b) Match zero or more characters that are open parenthesis(c) Match zero or more characters that are not open parenthesis(d) Match one or more characters that are open parenthesisThis question was addressed to me in final exam.This intriguing question comes from Pattern Matching and Regular Expressions in division Classes and Modules in JavaScript of JavaScript

Answer»

Correct choice is (c) Match zero or more characters that are not OPEN parenthesis

To EXPLAIN I would SAY: The [^…] character class is used to match or draw any one character not between the brackets. One should always be careful while using * and ? as REPETITION characters as they may match zero INSTANCES of whatever precedes them, they are allowed to match nothing.



Discussion

No Comment Found

Related InterviewSolutions