Which of the following is not a class of java.util.regex?
A. Pattern class
B. matcher class
C. PatternSyntaxException
D. Regex class
Answer: Option D
A. Pattern class
B. matcher class
C. PatternSyntaxException
D. Regex class
Answer: Option D
What is a regular expression in Java?
A. A pattern that describes a set of strings
B. A Java class for reading regular expressions
C. A Java method for creating strings
D. A Java package for file operations
Which class is used to compile a regular expression in Java?
A. `String`
B. `Regex`
C. `Matcher`
D. `Pattern`
In a regular expression, what does the metacharacter `.` represent?
A. A digit
B. A space
C. Any character
D. A word
What does the character class `[A-Za-z]` match in a regular expression?
A. Any special character
B. Any uppercase or lowercase letter
C. Any whitespace character
D. None of These
Join The Discussion