Which of the following will match the below regular expression?

String regex = "[A-Z][a-z0-9@$%&]{0,}([ ][A-Za-z]{1,})*";

"A@ "

"alex1"

"Alex2&"

"John snow"

Verified Answer
Correct Option - cd

To get all Self Assessment - Programming using Java Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Mon, 8 Dec 2025