In a regular expression, what does the metacharacter `*` represent?
A. A fixed number of occurrences of the preceding character or group
B. One or more occurrences of the preceding character or group
C. Zero or more occurrences of the preceding character or group
D. Exactly one occurrence of the preceding character or group
Answer: Option C
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. Any special character
Join The Discussion