I need to write a regular expression in Java which covers the following scenarios
Between 6-10 characters
Must be at least one numeral
I have been told that I should use Unicode convention in the regular expression as the input may be in many languages
Can anyone help?
For string length, just use the
.length()method. For matching, use\p{Digit}, this should do what you want and covers more than\d(although I fail to see what).So: