The question is not completely clear. If you mean that you can use between 3 and 10 characters, and these characters can be alphanumerical characters (digits and [A-Za-z]
), you can use:
/^(?=.*\d.*)[A-Za-z0-9]{3,10}$/
The regex works as follows:
^[A-Za-z0-9]{3,10}$
says the regex consists out of3
to10
characters that can be digits and/orA-Z
/a-z
.- The lookahead
(?=.*\d.*)
enfoces that the string contains at least one digit somewhere in the string.
10
solved I need REGEXP for alpha Numeric zip code, which contains minimum 3 & maximum 10 values [duplicate]