Regular Expressions In Java - Study Mode

[#1] What is a regular expression in Java?
Correct Answer

(A) A pattern that describes a set of strings

[#2] Which class is used to compile a regular expression in Java?
Correct Answer

(D) `Pattern`

[#3] In a regular expression, what does the metacharacter `.` represent?
Correct Answer

(C) Any character

[#4] What does the character class `[A-Za-z]` match in a regular expression?
Correct Answer

(B) Any uppercase or lowercase letter

[#5] In a regular expression, what does the metacharacter `*` represent?
Correct Answer

(C) Zero or more occurrences of the preceding character or group