I'm programming in Java and need to filter a String from a regex using the matches()
method.
I can accept letters (a-z) or numbers (0-9), where this number can have 1 or n digits. I'm using the following regex: [A-Z|a-z|\d{n} ]
.
The filter of the letters is working perfectly, but the one of the numbers is not accepting a number with more than one digit ( 10
for example), whereas numbers of a single digit are passing.
I do not know much about regex, but from what I read, this should work.