Java Programming
Accenture Technical PrimermediumJava Programming5. Regular Expression

The first name of a person should contain only alphabets and space. Which of the following regular expression will match the requirement?

Answer options

A
Which of the following regular expression will match the requirement?
B
[a-zA-Z ]+
C
[a-zA-Z ]
D
[\\s]
E
[\\s]+

Correct answer: [a-zA-Z ]+

Explanation

Quick AnswerThe correct answer is [a-zA-Z ]+ because it directly addresses the core logic of Java Programming.

Correct answer: [a-zA-Z ]+.

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!