1. 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 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
2. Which class is used to compile a regular expression in Java? A. `String` B. `Regex` C. `Matcher` D. `Pattern` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
3. In a regular expression, what does the metacharacter `.` represent? A. A digit B. A space C. Any character D. A word Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. 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 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
5. 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 & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
6. Which quantifier is used in a regular expression to match one or more occurrences of the preceding character or group? A. `*` B. `?` C. `{}` D. `+` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. In a regular expression, what does the metacharacter `^` represent when used at the beginning of a pattern? A. The start of a line B. The end of a line C. Any character D. A space Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
8. Which class is used to perform matching operations with regular expressions in Java? A. `String` B. `Regex` C. `Pattern` D. `Matcher` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. In a regular expression, what does the metacharacter `$` represent when used at the end of a pattern? A. The start of a line B. Any character C. The end of a line D. A digit Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
10. What does the character class `[0-9]` match in a regular expression? A. Any lowercase letter B. Any digit C. Any special character D. None of These Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board