I’m running some code through the eclipse debugger and
a.matches("[a-zA-Z]") is not equating to
a = "ABCD" (
a is a string array).
I’ve read the javadoc on
[a-zA-Z] should be a valid regular expression..
Anyone know where I’m going wrong?
Try using this expression:
[a-zA-Z]* (will match zero or more characters).
If you require at least one character, use:
The expression you’re using will only match a single alpha character since it’s not quantified.
Answered By – Rob Hruska
Answer Checked By – David Goodson (BugsFixing Volunteer)