I've run into some issues with this one and cannot find it in past questions.
Criteria:
Here is what I have made and the problems with each:
^(?!^\d*$)[a-zA-Z\d]{10}$
^[a-zA-Z0-9]{10}$
I have tried some others that meet all criteria but fail the 10 char limit.
Any help is appreciated.
You may use a second lookahead:
^(?!\d+$)(?![a-zA-Z]+$)[a-zA-Z\d]{10}$
See the regex demo and the Regulex graph:
Details
^
- start of string(?!\d+$)
- a negative lookahead that makes sure the whole string is not composed of just digits(?![a-zA-Z]+$)
- the whole string cannot be all letters[a-zA-Z\d]{10}
- 10 letters or digits$
- end of string.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With