Java Programming Lab
1) Which of the following is not a class of java.util.regex?
Pattern class matcher class PatternSyntaxException Regex class
2) What is the significance of Matcher class for regular expression in java?
interpretes pattern in the string Performs match in the string interpreted both pattern and performs match operations in the string None of the mentioned.
3) Object of which class is used to compile regular expression?
Pattern class Matcher class PatternSyntaxException None of the mentioned
4) Which capturing group can represent the entire expression?
group * group 0 group * or group 0 None of the mentioned
5) groupCount reports a total number of Capturing groups.
true False non explainable there are only 2 groups
6) Which of the following matches nonword character using regular expression in java?
\w \W \s \S
7) Which of the following matches end of the string using regular expression in java?
\z \\ \* \Z
8) What does public int end(int group) return?
offset from last character of the subsequent group offset from first character of the subsequent group offset from last character matched offset from first character matched
9) what does public String replaceAll(string replace) do?
Replace all characters that matches pattern with a replacement string Replace first subsequence that matches pattern with a replacement string Replace all other than first subsequence of that matches pattern with a replacement string Replace every subsequence of the input sequence that matches pattern with a replacement string
10) What does public int start() return?
returns start index of the input string returns start index of the current match returns start index of the previous match one of the mentioned
-->
Number of score out of 10 = Score in percentage =