Java Programming
Accenture Technical PrimereasyJava Programming5. Regular Expression

Assume that the ID of an employee should start with "CBE" or "BLR" or "HYD" followed by hyphen (-) followed by 4 digits. Choose the apt regular expression that matches this text.

Answer options

A
True
B
False

Correct answer: True

Explanation

Quick AnswerThe correct answer is True because it directly addresses the core logic of Java Programming.

The regex (CBE|BLR|HYD)-\d{4} matches IDs like CBE-1234.

Related Accenture Java Programming questions

Practice more Accenture Java Programming questions

PrimerPrep has 1400+ practice questions, 2026 simulations and coding hands-on — all free.

Watch Walkthroughs!